Live data from Hacker News

Dear web developers: set the font color, too

luu.io

61–70 of 151 posts

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

#61
post #49
post #38

Earlier quoted context omitted.

I struggle with how low contrast it is. I skip 'Ask HN' style posts because they are too hard to read.

> I skip 'Ask HN' style posts because they are too hard to read. That's done on purpose to discourage people from posting (or reading) them too often. PG was afraid letting people write text posts would lead to "blogging."

Can we get a source on this? Not disputing but I had never heard that before and it's interesting.

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

#62
post #49

Earlier quoted context omitted.

> I skip 'Ask HN' style posts because they are too hard to read. That's done on purpose to discourage people from posting (or reading) them too often. PG was afraid letting people write text posts would lead to "blogging."

Can we get a source on this? Not disputing but I had never heard that before and it's interesting.

https://news.ycombinator.com/item?id=468471

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

#63

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://caniuse.com/#feat=prefers-color-scheme

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

#64
post #60
post #3

Definitely agree accessibility is important going into 2019. Different users are going to be viewing a site with more screen readers, dark theme, and other alternative viewing options, very much like we saw with mobilegeddon and the advent of responsive design. I've seen the argument that this hurts the "intended web experience", but this can be solved by keeping up with modern CSS practices and crafting the experien…

I agree we need to give accessibility more priority and we likely will once the discrimination lawsuits start rolling in. But this isn't an accessibility issue. Nowhere in WCAG 2 will you find anything that explicitly outlines both color and background color need to defined in stylesheets. This is for users who prefer dark themes who are overriding styles of websites incorrectly. It is a failing of the user's browser…

You got it backward. The custom CSS of the website is overriding the system styles in this case. Let's take font-family for example. Just because you're setting the font for your input[text] tags doesn't mean the browser will also automatically set the font for other elements to match the style. If you want the website to have uniform look, then you'll need to set the font-family for other elements, too.

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

#65
post #51
post #41

Earlier quoted context omitted.

> he author is using something that manipulates the style of inputs to make them dark with light fonts > just style both at the same time That's exactly the point. The system by default sets both colors, though most browsers I've used allow the website to override the colors. In these cases, the websites only override one but not the other.

The system is failing to override the styles. This is an issue with the system not using more explicit selectors or not taking into account that their selectors will be overridden. In other words, the system has failed you.

User may not want the system to override styles, though. The system is providing defaults. The CSS overrides the defaults. The web developer has decided to override one default, but not the other default.

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

#66

Earlier quoted context omitted.

Would be cool, if websites would ask, if you like bright or dark website.

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

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

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

#67
post #5
post #4

Sure it's not an issue with whatever is doing that (hacky) dark mode CSS? Looking at the google example, they are setting the font color. It just doesn't look good when dark-mode CSS doesn't take the existing colors into account.

The dark mode is actually coming from the GNOME system colors, not browser plugin. 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.

> The dark mode is actually coming from the GNOME system colors, not browser plugin.

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.

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

#68
I'm curious: what is environment for these tests?

I want to reproduce to understand what's going on better.

(For what it's worth, in 10 sec of testing Safari and Chrome on MacOS dark mode don't seem to have this issue... the font and background colors seem to still default to dark on white.)

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

#69
post #51
post #41

Earlier quoted context omitted.

> he author is using something that manipulates the style of inputs to make them dark with light fonts > just style both at the same time That's exactly the point. The system by default sets both colors, though most browsers I've used allow the website to override the colors. In these cases, the websites only override one but not the other.

The system is failing to override the styles. This is an issue with the system not using more explicit selectors or not taking into account that their selectors will be overridden. In other words, the system has failed you.

> The system is failing to override the styles.

You're using the word "override"; what do you think the order of these things is? As far as I'm aware:

- The user sets their system's colours (e.g. for me that's white text and black background). These are used by all applications, including the browser.

- Web sites may override these defaults by providing CSS, e.g. Google dictionary forcing the text to be black

These bugs are caused by Facebook, Dropbox, Google, Twitter, etc. shipping broken overrides. It's a pretty minor problem (as this post's author acknowledges), but it's not the user's fault.

If these sites didn't try to override things, i.e. by providing plain, semantic HTML, then this problem wouldn't occur (some might prefer such sites!)

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

#70
post #6

Never though about this before, but, dark themes have only recently become widespread, so I'm not necessarily faulting web devs on this.

> dark themes have only recently become widespread

Have they? I've been having this problem for around 15 years :(

Nice to see it brought up somewhere so prominent though!

Post reply on HN