Live data from Hacker News

Dear web developers: set the font color, too

luu.io

101–110 of 151 posts

Re: Dear web developers: set the font color, too

#101
post #66

Earlier quoted context omitted.

Do you want a pop up every time you browse a page?

They can throw it in the popup that tells me about cookies.

How about a global setting that the user can set once which is what we have now.

Re: Dear web developers: set the font color, too

#102

Earlier quoted context omitted.

How else should a site query for the user preference? Everyone is operating in the blind right now.

Sites are already styled according to the user's preference, by default. If you want to respect the user's preference, stop overriding things with CSS.

Sites are styled by default browser stylings. When font changes are inherited from user's settings however, it basically just breaks everything.

For accessibility reasons, using the zoom feature is much more stable than increasing the default font size.

Re: Dear web developers: set the font color, too

#103

Apple introduced Dark Mode expecting all major websites to maintain some CSS just for a small percentage of macOS users. I don't think it's going to happen (and it's not happening)

This comment intrigued me, so I did some digging. Looks like "prefers-color-scheme" is currently being considered by both Chrome[1] and Firefox[2]. A can-I-use page was just created for it[3]. I'm excited by this one! Think I'll add dark mode support to my simple blog right now. [1] https://bugs.chromium.org/p/chromium/issues/detail?id=889087 [2] https://bugzilla.mozilla.org/show_bug.cgi?id=1494034 [3] https://canius…

Finished now! I ended up switching my SASS variables over to CSS4 variables so I could override them with media queries.

Now to wait for better browser support.

Re: Dear web developers: set the font color, too

#104
This is the browser's fault for violating the HTML spec. As per the specification, the default font color is complete black and the default background color is complete white. To my knowledge the only browser that does not honor this is Firefox[1], and it is an eighteen year old bug which they refuse to fix.

[1] https://bugzilla.mozilla.org/show_bug.cgi?id=70315

Re: Dear web developers: set the font color, too

#105

This is the browser's fault for violating the HTML spec. As per the specification, the default font color is complete black and the default background color is complete white. To my knowledge the only browser that does not honor this is Firefox[1], and it is an eighteen year old bug which they refuse to fix. [1] https://bugzilla.mozilla.org/show_bug.cgi?id=70315

I looked through the bug report and couldn't find the specification you're referencing. Do you have a link to it by any chance?

Re: Dear web developers: set the font color, too

#106

This is the browser's fault for violating the HTML spec. As per the specification, the default font color is complete black and the default background color is complete white. To my knowledge the only browser that does not honor this is Firefox[1], and it is an eighteen year old bug which they refuse to fix. [1] https://bugzilla.mozilla.org/show_bug.cgi?id=70315

It seems that chrome and chromium may also ignore the spec, as https://news.ycombinator.com/item?id=19056637 says. Hopefully prefers-color-scheme[0] will take over soon.

[0] https://developer.mozilla.org/en-US/docs/Web/CSS/@media/pref...

Re: Dear web developers: set the font color, too

#107
post #105

This is the browser's fault for violating the HTML spec. As per the specification, the default font color is complete black and the default background color is complete white. To my knowledge the only browser that does not honor this is Firefox[1], and it is an eighteen year old bug which they refuse to fix. [1] https://bugzilla.mozilla.org/show_bug.cgi?id=70315

I looked through the bug report and couldn't find the specification you're referencing. Do you have a link to it by any chance?

Just found it!

https://html.spec.whatwg.org/multipage/rendering.html#phrasi...

"The initial value for the 'color' property is expected to be black. The initial value for the 'background-color' property is expected to be 'transparent'. The canvas's background is expected to be white."

Re: Dear web developers: set the font color, too

#109

This is the browser's fault for violating the HTML spec. As per the specification, the default font color is complete black and the default background color is complete white. To my knowledge the only browser that does not honor this is Firefox[1], and it is an eighteen year old bug which they refuse to fix. [1] https://bugzilla.mozilla.org/show_bug.cgi?id=70315

Additionally, the “prefers-color-scheme” media query exists, which is the standard way to bring dark mode to the web and solves all the issues listed in the article by being opt-in. Firefox hasn’t implemented it, but neither has anybody but Safari yet.

Re: Dear web developers: set the font color, too

#110

Earlier quoted context omitted.

I just tested Firefox on xfce and it shows the problem. Safari, Firefox, and Chrome on MacOS in dark mode do not have this problem. This appears to just be a Firefox on linux issue.

Firefox is doing what is technically the correct thing in using system colors text color and background when not specified. 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…

I don't think you necessarily even have to check for colour similarity - we agree that setting only one attribute is broken, so just detect when only one attribute is set and either ignore it, or (if you feel like being clever) set the other attribute to be its complementary colour.
Post reply on HN