Earlier quoted context omitted.
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…
Wow, what an awful thing to standardise! Are there equivalents for high/low-contrast? Red themes, blue themes, multicolour themes, etc.? Why layer something like this on top of an override system, when devs can choose to just not override those things? As an example, the only CSS colours I use on chriswarbo.net are either semi-transparent, or mid-grey (which work on light and dark themes, although I might revisit tha…
Dear web developers: set the font color, too
91–100 of 151 posts
Re: Dear web developers: set the font color, too
#92Earlier quoted context omitted.
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.
Re: Dear web developers: set the font color, too
#93I'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
#94I'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.)
It happens to me on Linux. I have GTK and QT configured with dark themes. To overcome this, I have to configure Firefox with a default styling in ~/.mozilla/firefox/*/chrome/userContent.css: input, button { -moz-appearance: none !important; background-color: white; color: black; } textarea { -moz-appearance: none !important; background-color: white; color: black; } select { -moz-appearance: none !important; backgroun…
Re: Dear web developers: set the font color, too
#95Earlier quoted context omitted.
Wow, what an awful thing to standardise! Are there equivalents for high/low-contrast? Red themes, blue themes, multicolour themes, etc.? Why layer something like this on top of an override system, when devs can choose to just not override those things? As an example, the only CSS colours I use on chriswarbo.net are either semi-transparent, or mid-grey (which work on light and dark themes, although I might revisit tha…
How else should a site query for the user preference? Everyone is operating in the blind right now.
Re: Dear web developers: set the font color, too
#96Earlier quoted context omitted.
HN was designed for a small audience, and it intentionally did things to discourage growth. The goal was to preserve the community for longer.
If Hacker News wanted to discourage growth, they should have made the forum private and invite only. There was never any real chance of this forum going mainstream, not because it was too ugly and awkward but because it didn't have any mainstream appeal. Negative reinforcements like making the text purposely difficult to read mostly just punish existing users.
Re: Dear web developers: set the font color, too
#97Earlier quoted context omitted.
If Hacker News wanted to discourage growth, they should have made the forum private and invite only. There was never any real chance of this forum going mainstream, not because it was too ugly and awkward but because it didn't have any mainstream appeal. Negative reinforcements like making the text purposely difficult to read mostly just punish existing users.
Are you sure HN isn't mainstream? It's up to 19 million items.
Re: Dear web developers: set the font color, too
#98Definitely 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?
Still, I can't seem to be able to collapse thread branches because it requires javascript. That's a shame.
I wonder if w3m would recognize something like:
.collapse:checked + .content-and-replies-container {
display: none;
}Re: Dear web developers: set the font color, too
#99Earlier quoted context omitted.
It happens to me on Linux. I have GTK and QT configured with dark themes. To overcome this, I have to configure Firefox with a default styling in ~/.mozilla/firefox/*/chrome/userContent.css: input, button { -moz-appearance: none !important; background-color: white; color: black; } textarea { -moz-appearance: none !important; background-color: white; color: black; } select { -moz-appearance: none !important; backgroun…
Thanks for this! I've been dealing with this issue for a while now and somehow didn't think to use CSS to fix it (despite having a number of custom stylesheets for various sites).
Re: Dear web developers: set the font color, too
#100Earlier quoted context omitted.
The hackery is literally opening the users control center and clicking the icon for desktop theme and clicking on a different theme and clicking apply. This sets the users desktop colors. Firefox will pick this up and use these colors for elements on the page unless these elements are explicitly styled by the developer. So say the users theme specifies a grey or black background and white text. The developer wants a…
The developer was doing you a favor, by not overriding all your styles, preventing you from potentially downloading a bunch of unnecessary bytes, slowing down your browser with potentially unnecessary CSS rules and leaving it up to you to use your best judgement not to fubar the site. Like I've mentioned elsewhere, this is the old reset css debate. It's a calculated risk to address 99% of users who don't have their b…
Overriding one value and not the other isn't doing the user a favor it predictably results in broken behavior that you could 100% avoid by designing your page competently. The 2 colors are implicitly related and need to be chosen together to result in a readable result.
The fact that it works okay on most systems does not indicate that your work is correct.
100% broken code per standards that happened to work under internet explorer 6 wasn't correct under the principle that people could just use ie.
This is only different in that this debate is more nonsensical because the correct behavior is so easy to achieve.
The default background being light isn't an actual default and if you depend on it then it is no different than depending on the user speaking English having 3 names text being ltr.
Its calculated nothing because setting the background color increases how predictable your look and feel is. There are zero downsides to doing so.