Live data from Hacker News

Using Dark Mode in CSS with MacOS Mojave

paulmillr.com

11–20 of 128 posts

Re: Using Dark Mode in CSS with MacOS Mojave

#11

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…

Would imagine they'll add the option in browsers to override the operating systems setting.

Re: Using Dark Mode in CSS with MacOS Mojave

#12

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…

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.

Re: Using Dark Mode in CSS with MacOS Mojave

#13

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…

I'd assume this is intended for web pages/apps to allow their in-page controls/navigation to fade into the background, revealing the content.

E.g. in a crud app with top/side nav, and then a form in the main section, the nav bars can be rendered as pale/dark to suit the user selection, while the main content area retains the focus.

Re: Using Dark Mode in CSS with MacOS Mojave

#14

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…

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.

As someone else pointed out (https://news.ycombinator.com/item?id=18298848) this is in a draft for CSS Media Queries level 5

Re: Using Dark Mode in CSS with MacOS Mojave

#15

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…

Would imagine they'll add the option in browsers to override the operating systems setting.

Third-party ones (Mozilla, Google) may but I'll be surprised if Apple and Microsoft don't just tie it to their respective OS' 'dark mode' setting.

Re: Using Dark Mode in CSS with MacOS Mojave

#16

This is a very interesting step, considering that Apple's interface guidelines prefer that application "content" remain regularly styled (e.g. as Pages does). This seems to show that Safari's web view has been changed from being merely content to being part of the user interface, as it would in say web applications. Presumably document creation websites e.g. Google Docs would be encouraged to maintain a light-themed…

I think it's acknowledging that part of the safari window can be 'chrome'.

I think navigation bars (either for regular sites or functional web apps) are good candidates for honouring this setting.

Re: Using Dark Mode in CSS with MacOS Mojave

#17

Dark Reader for Safari makes the web dark automatically when Dark Mode is enabled: https://darkreader.org/safari/ Unfortunately it doesn't work in Chrome or Firefox yet, as they haven't implemented proper APIs.

I tried another one of these ("Dark Mode for Safari") (https://itunes.apple.com/th/app/dark-mode-for-safari/id13971...) and was not overly impressed with the results. I guess maybe I need to be more selective about which sites it's used on.

Edit:

Ok, I've just noticed that

a) the app I have now (or maybe always?) has a couple of different levels "softer dark mode" is much nicer - it's not pure black for backgrounds.

b) using it more selectively (i.e. not just on/off for all sites) seems to work much better than just turning it on open-slather.

Re: Using Dark Mode in CSS with MacOS Mojave

#18

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…

I'd assume this is intended for web pages/apps to allow their in-page controls/navigation to fade into the background, revealing the content. E.g. in a crud app with top/side nav, and then a form in the main section, the nav bars can be rendered as pale/dark to suit the user selection, while the main content area retains the focus.

Yes, I definitely see the appeal for web apps.

Just personally don't want to read 2,000+ word articles of white text on a dark background just because I like the browser UI to be dark. Others might, though — hopefully browsers will offer a setting for dark mode independent of the OS-level setting.

Re: Using Dark Mode in CSS with MacOS Mojave

#19

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.

As someone else pointed out ( https://news.ycombinator.com/item?id=18298848 ) this is in a draft for CSS Media Queries level 5

Hm, okay. Then it might make sense to support this, if your user base heavily relies on MacOS. Thanks for the link.

Re: Using Dark Mode in CSS with MacOS Mojave

#20

This is a very interesting step, considering that Apple's interface guidelines prefer that application "content" remain regularly styled (e.g. as Pages does). This seems to show that Safari's web view has been changed from being merely content to being part of the user interface, as it would in say web applications. Presumably document creation websites e.g. Google Docs would be encouraged to maintain a light-themed…

However, Mail does have a dark stylesheet for the viewer when Dark Mode is enabled. I guess this can be done when there's a concept of a base stylesheet which people can the overwrite if needed. Word processors don't have this concept, and what you see is (supposed to be) always exactly what you get. So Pages doesn't display dark documents because the output then should be a dark document.

Apple is proposing a new CSS color-filter property [1], which would do the same thing as Mail does for its content. Actually, Apple is already using color-filter internally in the Mail app.

Safari allows setting user style sheets in its Preferences: Advanced > Style sheet, so one could perhaps add a user style sheet with color-filter.

[1] https://github.com/w3c/csswg-drafts/issues/2875

Post reply on HN