Live data from Hacker News

Using Dark Mode in CSS with MacOS Mojave

paulmillr.com

41–50 of 128 posts

Re: Using Dark Mode in CSS with MacOS Mojave

#41
post #5

Firefox has the option to set default colours based on your theme, so mine are set to dark colours. However, I find that many sites become unusable because they assumed the user defaults would be black text on white background. I use Stylus to override things which sometimes works but not always. Is there actually a way to fix this?

> Is there actually a way to fix this?

In the color preferences, set "Override the colors specified by the page with your selections above" to "Always". By default Firefox does this automatically when the OS is in high contrast mode.

Re: Using Dark Mode in CSS with MacOS Mojave

#46

Earlier quoted context omitted.

Also while it's very cool that they support this in Safari, I highly doubt someone will do CSS adjustments JUST for Safari users like this. Either your page already has a dark theme or you won't really bother about this.

If you can justify dozens of CSS adjustments for IE11, it isn't much of a stretch to spend half that amount of time making something cool for (typically) higher value Safari users as well.

What do you mean by "higher value"? Getting IE11 to work will net you an extra 2.85% of the market, but adding a very minor feature that's only usable by Safari users doesn't seem to be profitable at all.

Re: Using Dark Mode in CSS with MacOS Mojave

#47
post #38

This is a great blog post to build awareness of the prefers-color-scheme feature. But I don't think it's safe to assume that someone who sets a dark UI also wants web pages displayed like that. I set dark mode in macOS to have the UI fade into the background and reveal the content; I don't want or expect that websites will present white text on a dark background too. That's fine for coding but can be less readable fo…

This is why I think they should focus on exposing the dark mode setting in Javascript instead of CSS. Sites that support dark mode should (and will almost always) have a toggle for it. It'd be better if this setting helped _inform_ the default initial state rather than _forcing_ a choice on you. To me, that's a lot easier done with a Javascript API than CSS.

You could easily apply or remove the css via Javascript to allow enable / disable of the feature.

Re: Using Dark Mode in CSS with MacOS Mojave

#49
I recently heard about the Dark Reader extension for Chrome, which lets you toggle dark settings per website in a fairly intelligent way. https://chrome.google.com/webstore/detail/dark-reader/eimadp... I'm really liking it, and I'd be interested to hear about something similar for Firefox.

Re: Using Dark Mode in CSS with MacOS Mojave

#50

I recently heard about the Dark Reader extension for Chrome, which lets you toggle dark settings per website in a fairly intelligent way. https://chrome.google.com/webstore/detail/dark-reader/eimadp... I'm really liking it, and I'd be interested to hear about something similar for Firefox.

Dark Reader is available for Firefox as well:

https://addons.mozilla.org/en-US/firefox/addon/darkreader/

Post reply on HN