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 » Tue Mar 27, 2018 6:38 pm

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 5
Level 5
Posts: 697
Joined: Fri Sep 05, 2014 12:18 am
Location: Britisher...

Re: Dark theme but white textbox background?

Post by smurphos » Tue Mar 27, 2018 11:21 pm

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

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.

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 userContent.css to /$HOME/.mozilla/firefox/usersprofile.default folder in order to fix issues with text visibility in input fields with some themes
cd ~/.mozilla/firefox/
if [[ $(grep '\[Profile[^0]\]' profiles.ini) ]]; then 
    PROFPATH=$(grep -E '^\[Profile|^Path|^Default' profiles.ini | grep -1 '^Default=1' | grep '^Path' | cut -c6-);
else
    PROFPATH=$(grep 'Path=' profiles.ini | sed 's/^Path=//');
fi
TARGETPATH="$HOME/.mozilla/firefox/$PROFPATH/chrome";
TARGETFILE="$HOME/.mozilla/firefox/$PROFPATH/chrome/userContent.css";
TARGETSTRING="input, textarea { color: #222; background: #eee; }";
if [ ! -d "$TARGETPATH" ]; then
    mkdir "$TARGETPATH";
    echo "creating folder $TARGETPATH";
    echo "";
fi
if [ ! -f "$TARGETFILE" ]; then
    touch "$TARGETFILE";
    echo "creating file $TARGETFILE";
    echo "";
fi
echo "$TARGETSTRING" >> "$TARGETFILE";
echo "writing  string '$TARGETSTRING' to $TARGETFILE";
echo "";
echo "please restart Firefox for fix to take effect";
echo "";
read -p "Press enter to exit the script.";
cd;
exit;

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 » 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.

User avatar
smurphos
Level 5
Level 5
Posts: 697
Joined: Fri Sep 05, 2014 12:18 am
Location: Britisher...

Re: Dark theme but white textbox background?

Post by smurphos » Thu Mar 29, 2018 12:20 am

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.

User avatar
I2k4
Level 4
Level 4
Posts: 471
Joined: Thu Feb 02, 2012 8:33 pm

Re: Dark theme but white textbox background?

Post by I2k4 » Sat Apr 21, 2018 2:52 pm

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. Ubuntu / Mint user since 10.04 LTS. M17.3 Cinnamon (Dell 1520). Dual booting M17.3 XFCE / W7 (Acer netbook) and M18.3 Cinnamon / W7 (Lenovo desktop). Testing M19.x 64bit on live USB.

spinkywix
Level 1
Level 1
Posts: 1
Joined: Mon Jun 04, 2018 4:22 pm

Re: Dark theme but white textbox background?

Post by spinkywix » Mon Jun 04, 2018 4:25 pm

Hi,

Many thanks for posting this fix, I am grateful.

Post Reply

Return to “Other topics”