Dark theme but white textbox background?

Questions about other topics - please check if your question fits better in another category before posting here
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
wibus

Dark theme but white textbox background?

Post by wibus »

hello,

is it possible to use Themes > Controls > Mint-Y-Dark, but keep textfields white?
Atleast in Firefox I notice most input fields have a dark background with this theme on, and a black font, so it's very difficult to read
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
smurphos
Level 18
Level 18
Posts: 8498
Joined: Fri Sep 05, 2014 12:18 am
Location: Irish Brit in Portugal
Contact:

Re: Dark theme but white textbox background?

Post by smurphos »

It's a Firefox bug with the way it interprets dark themes.

::::::Edited post::::::

A workaround is to create a user.js file in ~/.mozilla/firefox/1234567.default with the contents user_pref("widget.content.gtk-theme-override", "Adwaita"); which forces firefox to use Adwaita (the default GTK theme) to theme website content.

1234567.default is a placeholder for whatever Firefox has named your default profile folder.

Here is a small script here which can automate this process. Copy and paste into a text file, save as Firefox_fix.sh or similar, make executable and run in a terminal window to create the file in the correct location.

Code: Select all

#!/bin/bash
#Description: Helper file to write user.js to /$HOME/.mozilla/firefox/usersprofile.default folder in order to fix issues with text visibility in input fields with some themes
if find "$HOME"/.mozilla/firefox/ -maxdepth 1 -type d -name '*.default' | head -1; then 
    TARGETPATH=$(find "$HOME"/.mozilla/firefox/ -maxdepth 1 -type d -name '*.default' | head -1)
    TARGETFILE="$TARGETPATH/user.js"
	TARGETSTRING="user_pref(\"widget.content.gtk-theme-override\", \"Adwaita\");"
	if [ ! -f "$TARGETFILE" ]; then
		touch "$TARGETFILE"
		echo "creating file $TARGETFILE"
		echo ""
	fi
	if ! grep -q "widget.content.gtk-theme-override" "$TARGETFILE"; then
		echo "$TARGETSTRING" >> "$TARGETFILE"
		echo "writing  string '$TARGETSTRING' to $TARGETFILE"
		echo ""
		echo "please restart Firefox for fix to take effect"
	else
		echo "$TARGETFILE already contains a widget.content.gtk-theme-override"
	fi
else
    echo "could not locate your .default firefox profile"
fi
echo ""
read -rp "Press enter to exit the script."
exit
Last edited by smurphos on Sun Aug 26, 2018 8:22 am, edited 1 time in total.
For custom Nemo actions, useful scripts for the Cinnamon desktop, and Cinnamox themes visit my Github pages.
gunnar26

Re: Dark theme but white textbox background?

Post by gunnar26 »

hi,
I have the same issue as the OP and am posting for clarification.
do I do this first:

[A workaround is to create a userChrome.css file in ~/.mozilla/firefox/1234567.default/chrome with the contents input, textarea { color: #222; background: #eee; } which forces firefox to use very dark grey text on a very light grey background for input fields.]

and then execute the script or is it all in the script.
User avatar
smurphos
Level 18
Level 18
Posts: 8498
Joined: Fri Sep 05, 2014 12:18 am
Location: Irish Brit in Portugal
Contact:

Re: Dark theme but white textbox background?

Post by smurphos »

gunnar26 wrote: Wed Mar 28, 2018 4:28 pm hi,
I have the same issue as the OP and am posting for clarification.
do I do this first:

[A workaround is to create a userChrome.css file in ~/.mozilla/firefox/1234567.default/chrome with the contents input, textarea { color: #222; background: #eee; } which forces firefox to use very dark grey text on a very light grey background for input fields.]

and then execute the script or is it all in the script.
Hi,

No - it's one or the other. The script just automates applying the described workaround.
For custom Nemo actions, useful scripts for the Cinnamon desktop, and Cinnamox themes visit my Github pages.
User avatar
I2k4
Level 5
Level 5
Posts: 784
Joined: Thu Feb 02, 2012 8:33 pm

Re: Dark theme but white textbox background?

Post by I2k4 »

It's bothered me for some years that the really dark themes black out login, etc. boxes and don't compensate with a readable white font. I've usually done a mix and match of dark elements but with Controls that created too much light space - but they worked. Recently discovered "Jet-Grey" Cinnamon theme that manages a pretty nice balance of mainly dark without the readability problems the deep dark themes all seem to produce.
TRUST BUT VERIFY any advice from anybody, including me. Mint/Ubuntu user since 10.04 LTS. LM20 64 bit XFCE (Dell 1520). Dual boot LM20 XFCE / Win7 (Lenovo desktop and Acer netbook). Testing LM21.1 Cinnamon and XFCE Live for new Lenovo desktop.
spinkywix

Re: Dark theme but white textbox background?

Post by spinkywix »

Hi,

Many thanks for posting this fix, I am grateful.
User avatar
smurphos
Level 18
Level 18
Posts: 8498
Joined: Fri Sep 05, 2014 12:18 am
Location: Irish Brit in Portugal
Contact:

Re: Dark theme but white textbox background?

Post by smurphos »

An improved fix for this issue is described in my post above - viewtopic.php?p=1450174#p1450174
For custom Nemo actions, useful scripts for the Cinnamon desktop, and Cinnamox themes visit my Github pages.
Locked

Return to “Other topics”