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 please read how to get help
Post Reply
wibus
Level 1
Level 1
Posts: 22
Joined: Fri Feb 23, 2018 9:17 pm

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
User avatar
smurphos
Level 17
Level 17
Posts: 7332
Joined: Fri Sep 05, 2014 12:18 am
Location: Britisher
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
Level 1
Level 1
Posts: 5
Joined: Sun Mar 18, 2018 4:56 pm

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 17
Level 17
Posts: 7332
Joined: Fri Sep 05, 2014 12:18 am
Location: Britisher
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: 678
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 booting LM20 XFCE / Win7 (Lenovo desktop and Acer netbook).
spinkywix
Level 1
Level 1
Posts: 3
Joined: Mon Jun 04, 2018 4:22 pm

Re: Dark theme but white textbox background?

Post by spinkywix »

Hi,

Many thanks for posting this fix, I am grateful.
User avatar
smurphos
Level 17
Level 17
Posts: 7332
Joined: Fri Sep 05, 2014 12:18 am
Location: Britisher
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.
Post Reply

Return to “Other topics”