In most examples, they're setting the background colour without corresponding font colour. In the Google example, they're making the opposite mistake.
One should set both or none.
From inspecting the CSS in the developer console, the cases in the screenshot either set the background color without setting the text color, or vice versa.
Web developers are just not terribly competent. It should be obvious that setting text color but not text background is erroneous. Since expecting basic competence from web developers seems to be a losing battle several things suggest themselves.
- provide a gui option to select the theme/style to use for firefox separate from the gui. This is already possible at the command line.
- Explicitly check for text that is to close to the background wherein only one attribute is set and adjust the smartest solution
- Just ignore the users colors like chrome does.
Personally I have a dark gtk theme but run firefox with a light one because otherwise the web is unusable.
or whatever your desired theme is
in fact I have the following fish shell function
function withtheme
env GTK_THEME=$argv[1] $argv[2..-1]
end
For my browser I run withtheme Adwaita:light aurora -P defaultYou can copy the firefox desktop file from /usr/share/applications to ~/.local/share/applications and edit the exec line as you please.
It's the same when you are using classic Windows theming and change the colors. The default background and font colors adjust accordingly (in Firefox, Chrome and Chromium-based things like Steam), which means that (many) pages that only alter the font color to say #333, but don't change the background color, become completely unreadable. Black on black.
Did you read the accompanying text? What you've said is literally the exact opposite of what is happening.
Google's CSS is not taking the default system colours into account. All of these sites seem to be assuming that the default system colours, implemented by the OS, are black text and white backgrounds. There is no reason to assume this, and indeed this is not the case on a minority of machines. The author's system happens to use white text and black backgrounds. So do I. Others are using low-contrast grey-on-grey themes, still others have a variety of multicoloured themes.
The author is trying to spread awareness that this seemingly common assumption about default colours is wrong. Hopefully this awareness has reached at least one person (yourself) ;)
I guess I could've made that point more clear in the post. Thanks for your replies in this thread :)