Live data from Hacker News

Dear web developers: set the font color, too

luu.io

31–40 of 151 posts

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

#31

Earlier quoted context omitted.

I have a dark theme enabled on xfce, and this is not a problem for me in chromium. The inputs in native apps are dark, but they are the default light color in web pages on chromium.

Really? I might have to switch then.. I use Firefox and GNOME, and enabling one of the dark themes causes most forms on the web to become unusable because of this very issue.

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.

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

#32
I am not sure if web developers are to blame here. It would probably be way more consistent to define default colors based on a standard instead of some local settings. However, if you change the colors you should make sure to do so for all related ones to avoid this.

For Linux you can setup Firefox to use a different theme for content widgets which can fix assumptions developers have about the default colors.

I've configured it in the about:config page like this:

widget.content.gtk-theme-override;Adwaita:light

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

#33

I hit this same same issue too. I tried to eliminate white backgrounds, because I find it tiring on my eyes and a bit painful. These sites made it too annoying to change the defaults, so I ended up giving up (and just always having my screen brightness near minimum). But before I gave up I started collecting sites that either set background-color and not font color, or set color but not background-color: https://gist…

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, so no one notices, but it means the option is gone for people who do want to modify them.

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

#34
Browsers on macOS appear to be smart enough to not pass through the system dark theme to web content. I'm seeing white forms in Safari and Firefox (Chrome doesn't seem to support dark theming at all).

As much as I'm a proponent of OS-native UX, CSS styling of form controls on the web has been a crapfest ever since IE(?) introduced it way back when. Whenever CSS touches a web form control it should just go completely custom-rendered. If you want to impose a dark theme on web content, you should use an intelligent browser extension that does things like verify text contrast.

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

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

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

#36

Earlier quoted context omitted.

I have a dark theme enabled on xfce, and this is not a problem for me in chromium. The inputs in native apps are dark, but they are the default light color in web pages on chromium.

Really? I might have to switch then.. I use Firefox and GNOME, and enabling one of the dark themes causes most forms on the web to become unusable because of this very issue.

env GTK_THEME=Adwaita:light firefox

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 default

You can copy the firefox desktop file from /usr/share/applications to ~/.local/share/applications and edit the exec line as you please.

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

#37
post #5

Earlier quoted context omitted.

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.

I have a dark theme enabled on xfce, and this is not a problem for me in chromium. The inputs in native apps are dark, but they are the default light color in web pages on chromium.

It was a problem for me using Firefox, but there's a workaround: You can set the GTK theme Firefox uses for inputs to a light theme.

https://bugzilla.mozilla.org/show_bug.cgi?id=1283086#c7

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

#38
post #12
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…

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.

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

#39

Or you could entirely avoid this issue by using multi-font themes with different weights, decorations, and ligatures.

What does that have to do with color and backgroundColor?

How does it not?

The article even states: "Don't set the colors at all, let the browser use the system default color".

If a developer wants to express some intent maybe utilizing something else other than color would resolve some of these issues. If I can develop without color a user can read without color https://github.com/maio/eink-emacs

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

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

Post reply on HN