Follow

FFS, people, put background colours on your web sites!

Instead of making me open up my developer console and type in document.body.style.backgroundColor = 'white' every time, type body { background-color: white; } once and save some folks some effort.

@aral maybe you could do a web extension to do it everywhere a save yourself lot of efforts

@aral or change your browser (firefox?) default background color to white ?

about:config
browser.display.background_color

@ronane Yeah, will have to do that. I have the colour set dark for a reason (I have a dark theme and I don’t want a flashlight in my face whenever I open a new tab.)

@aral I understand that. I loved darktheme but I had the same problem and I become tired to fight against configurations.

I think a tiny webext that check if body background isn't set first could be the best answer in the way it shouldn't change your default color in "chrome" tabs

@ronane @aral does your theme set dark bgs but no light fg? If so, it's your theme's fault.

If the site sets a dark fg but doesn't set a bg then it's the site's fault.

Out of curiosity, which is it here?

@thinkMoult @ronane It’s not the theme. I set the background colour of my tab to a dark colour so it doesn’t flash on new tab open. Regardless, setting a background colour on your web site is a tiny piece of effort to enable better accessibility.

@aral @thinkMoult @ronane If they're not setting *either* a foreground or background color, then this is your fault, not theirs.

Web design accessibility standards say to always set _both or neither_, last I checked. If you're only changing the background without changing the foreground, you're just mucking it up for yourself. vOv

@varx @aral @ronane I see - my blog thinkmoult.com/ sets neither. So it should work well for you? I would assume so, because it should fallback to default browser CSS which we would hope is crafted to comply with WCAG.

If not, I suspect that the default browser CSS needs to be fixed?

Out of curiosity, where did you see that you need to always set both or neither? I don't see it in WCAG w3.org/TR/WCAG20/ ?

@thinkMoult @aral @ronane I learned it through oral tradition, but this quote appears to match:

« Note 4: [...] It is a failure if no background color is specified when the text color is specified, because the user's default background color is unknown and cannot be evaluated for sufficient contrast. For the same reason, it is a failure if no text color is specified when a background color is specified. »

Default browser CSS is fine: Black on white.

@thinkMoult @aral @ronane The sneaky problem is when someone sets a (e.g.) dark background image and light text color, and the image isn't loaded, leading to light-on-white. :-)

@aral maybe default values should work more properly..

@jasper @aral yeah this is what I was wondering. I'm on mobile but if they're focusing the foreground color to black without setting a background color then that's just evil

@jalcine @aral could uh yeah i was dumb not properly considering it..

Although somewhat more complex defaults can still deal with it. I.e. if one of the two is specified, put the other at the "maximum opposite side", for instance..

@aral This page doesn't specify any background-color nor font-color, isn't up to the parent window to provide a legible default? If you have an OS dark theme, shouldn't the default text color be light?
@aral completely forgot to do this because so many site generators don't by default! Went to my personal site on qutebrowser and nearly had a stroke
Sign in to participate in the conversation
Aral’s Mastodon

This is my personal Mastodon.