Live data from Hacker News

Dear web developers: set the font color, too

luu.io

41–50 of 151 posts

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

#41
post #35

I don't understand this article. The author is using something that manipulates the style of inputs to make them dark with light fonts... but only if the input isn't explicitly styled with either background-color or color . If they're going to be doing such hackery, just style both at the same time. Use JavaScript or something to ensure both are styled. This really isn't the developer's concern.

> 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.

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

#42

Earlier quoted context omitted.

there's a contrast/brightness button on most hardware, why have low contrast websites by design? just tune your monitor! it will then work for websites, games and everything else. it will also allow you to handle contrast reducing it at night and tuning up when the monitor is struck with some glare, without having to change the css! imagine the convenience! software developer: using hammers for everything since 1842

I don't want low contrast, I just wanted to swap my browser default foreground/background colors (low brightness is just my hacky workaround). The "bug" on these sites is that if devs set a default background-color they should also set a default font color: either set neither properties, or set both. Setting one means the default of the browser will be used. Most of the time it's background=white, foreground=black, s…

> I don't want low contrast

> I tried to eliminate white backgrounds, because I find it tiring on my eyes and a bit painful.

yes, yes that's exactly what you want. besides you can tune both gamma and tone both in software and hardware on most platforms; this isn't rocket science people had the ability to tune the monitors to their liking since television had colors

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

#43
post #35

I don't understand this article. The author is using something that manipulates the style of inputs to make them dark with light fonts... but only if the input isn't explicitly styled with either background-color or color . If they're going to be doing such hackery, just style both at the same time. Use JavaScript or something to ensure both are styled. This really isn't the developer's concern.

From the article: > Though, that might be a problem for some users, especially those with a default dark theme on their systems. It's a real issue, every time I set a dark theme, web pages become affected because the defaults get changed. I think the issue should be fixed by the browser vendor really. Eventually I get frustrated enough to just disable it altogether.

> I think the issue should be fixed by the browser vendor really.

Yes, I agree. Or whoever built the dark theme. They should be checking whether inputs have been overrided with styles for both background/color or none.

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

#44
post #35

I don't understand this article. The author is using something that manipulates the style of inputs to make them dark with light fonts... but only if the input isn't explicitly styled with either background-color or color . If they're going to be doing such hackery, just style both at the same time. Use JavaScript or something to ensure both are styled. This really isn't the developer's concern.

It is the developer's concern. If one layer of presentation sets either the foreground or background color, it also must set the other. The C in CSS is cascading. Different sets of rules can be applied with differing precedence. There's no spec that I'm aware of the states that black on white is the default user-agent styling. If your site is unusable with inverted colors, it's your site that's broken.

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

#45
This is a real issue for me at times. I have a dark theme set in Gnome, because I want dark system windows, but lots of sites don't bother setting their colours properly, so if I open the Web UI for my Ubiquiti Router, or one of my switches, and try to select a drop-down, the background of it is dark, like my system theme, and the text is dark, so I can't see what I'm choosing.

Other times, like if I'm entering text into the Name field for ports on my switch (Ubiquiti) the background is white, the text is white and so I can't see what I've entered until I select all.

These aren't such a big issue so much as an irritation, but, lets same I'm trying to login to something, at times I can't see the username/email I've entered until I highlight, not such an issue for passwords because we do this blindly anyway most of the time.

I'd prefer if Firefox wasn't using my system UI elements at all, but even toggling the hidden config doesn't seem to make any difference there.

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

#46
post #19

What has happened to the concept of "User Defined CSS"? Is it totally gone? Did Chrome kill it? Browsers should be making this a prominent and first-class feature. Users should be able to quickly and easily set their default styles for various elements and choose at what precedence level they apply.

Browsers have supported user defined CSS defaults since forever, and plugins like Stylish have been around for a while. The practice of users customizing their CSS isn't prevalent because modern sites are incredibly complex and the average user doesn't want (or know how) to spend the time necessary to reverse engineer a site's layout and rewrite its CSS - there is no "quick and easy" way to do that for any but the si…

> Browsers have supported user defined CSS defaults since forever, and plugins like Stylish have been around for a while.

It looks like Chrome removed these several years ago:

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

Plugins are a thing but why should you need a plugin for something that is a core part of the CSS specification?

https://www.w3.org/TR/CSS2/cascade.html#cascade

> the average user

This is (mostly) about accessibility. Even if the average user does not need it, some do. And those that do would be quite glad to have it easily.

> there is no "quick and easy" way to do that for any but the simplest sites

Just because user stylesheets have been ignored for many years doesn't mean they shouldn't be acknowledged. Design your site with them in mind.

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

#47
post #43

Earlier quoted context omitted.

From the article: > Though, that might be a problem for some users, especially those with a default dark theme on their systems. It's a real issue, every time I set a dark theme, web pages become affected because the defaults get changed. I think the issue should be fixed by the browser vendor really. Eventually I get frustrated enough to just disable it altogether.

> I think the issue should be fixed by the browser vendor really. Yes, I agree. Or whoever built the dark theme. They should be checking whether inputs have been overrided with styles for both background/color or none.

Funnily enough I think this is specific to Linux, I've not encountered this issue under Windows, and I don't think macOS has a dark mode.

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

#48

What has happened to the concept of "User Defined CSS"? Is it totally gone? Did Chrome kill it? Browsers should be making this a prominent and first-class feature. Users should be able to quickly and easily set their default styles for various elements and choose at what precedence level they apply.

Not disagreeing, but why is this a good thing? Apart from that it's fun, are users really expected to be able to improve their browsing experiences with custom CSS?

> are users really expected to be able to improve their browsing experiences with custom CSS

Actually, yes:

https://www.w3.org/TR/CSS2/cascade.html#cascade

User stylesheets are supposed to be applied at a precedence level below the page author's style, so any time the page author did not specify a style, the user's style can be used as default.

Browsers should have made this an easily accessible feature, but they seem to instead like to remove access to it. Think "Developer tools window", but persistent.

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

#49
post #38
post #12

Earlier quoted context omitted.

How does HN stack up in terms of accessibility? Anyone using a screen reader with HN? What do you wish was different?

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."

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

#50
post #35

I don't understand this article. The author is using something that manipulates the style of inputs to make them dark with light fonts... but only if the input isn't explicitly styled with either background-color or color . If they're going to be doing such hackery, just style both at the same time. Use JavaScript or something to ensure both are styled. This really isn't the developer's concern.

It is the developer's concern. If one layer of presentation sets either the foreground or background color, it also must set the other. The C in CSS is cascading. Different sets of rules can be applied with differing precedence. There's no spec that I'm aware of the states that black on white is the default user-agent styling. If your site is unusable with inverted colors, it's your site that's broken.

No, it isn't the developer's concern. You use cascading styles for a reason: so they can cascade. If I had to explicitly set the color, background color, font size, font weight, etc. everywhere, this would defeat the purpose of using CSS. It would bloat up stylesheets into giant download-speed-killing blobs.
Post reply on HN