Ubuntu – Need to modify gnome 3 theme for browser


I have recently begun using the DarkGreen theme for Gnome 3, however there are some problems on some webpages in FireFox regarding text input fields. This happens in the search field on Google, some fields on Facebook, etc…

This theme uses a dark background and light color text for input fields by defaut. I have managed to modify the foreground color of input text succesfully for those fields that were never affected (from near white to gray), but it doesn't help for the "broken" fields. I also want to change the background color for all input fields to white, but I get no luck with that either.

In the theme folder there is a gtk folder with a css file. Here are the relevant contents, the comments are what I changed:

@define-color theme_base_color #202020;
@define-color theme_text_color #25DC00; /* #ffffff */
@define-color theme_bg_color #121212;
@define-color theme_fg_color @theme_text_color;
@define-color selected_bg_color #3E8753;
@define-color selected_fg_color #ffffff;
@define-color theme_selected_bg_color @selected_bg_color;

@define-color menu_bg_color #555555;
@define-color menu_fg_color @theme_text_color;

@define-color menu_combobox_border @theme_selected_bg_color;
@define-color menu_separator mix (@theme_bg_color, @menu_bg_color, 0.90);

@define-color insensitive_bg_color alpha(#0b0b0d, 0.0);
@define-color insensitive_fg_color alpha(#717171, 0.50);
@define-color insensitive_border_color alpha(#717171, 0.50);

@define-color entry_text_color /* #fafafa */ #707070;
@define-color entry_background_a #ffffff;
@define-color entry_background_b #ffffff;
@define-color entry_background_c #ffffff;
@define-color entry_background_d #ffffff; /* 121212 */

@define-color frame_color #707070;

Is this CSS file the only thing I would need to change?

Best Answer

I'm suggesting a different way that is specific to Firefox to achieve what you want.

Close (exit) all instances of Firefox.
Go to your profile folder. It is here: /home/your_name/.mozilla/firefox/randomstring.default
In there, look for a subfolder called chrome. If it doesn't exist, create it.
If chrome does exist, look for a file called userContent.css. Otherwise, create an empty file with this name in the chrome folder.
Now open userContent.css with a text editor and paste in this code:
INPUT, TEXTAREA {color: black !important; background: #aaaaaa !important; }

Save the file (as plain text) and close the text editor.
Restart Firefox.
You should now have black text on a light gray background. You can use whatever color combination you prefer.

Notes: chrome and userContent.css are case-sensitive and should be spelled correctly.
The settings here will take precedence over those in the OS theme and will remain the same in Firefox irrespective of which gtk theme you switch to.

(By the way, you maybe interested in the Stylish extension and a whole variety of styles created by users and hosted at userstyles.org.)

I'm providing some links related to users wanting Firefox not to be influenced by the OS (gtk) theme. Please note that I have not checked whether the solutions suggested still work or not. These links are more by way of background:
How can one make firefox ignore my GTK theme entirely?
Bug 70315 - text in menus and boxes unreadable if using dark GTK theme (for Seamonkey)
Any way to prevent Firefox from using the OS native colors?

Related Question