Can a website running in Safari detect Dark Mode?

I love the Dark Mode feature of macOS Mojave. Some of my apps have already updated with their dark mode interfaces.

I was wondering if there was some way for a website to detect whether Safari or macOS is running in Dark Mode so I can provide an alternate stylesheet to make the website reflect the chosen mode?

It looks like there’s some talk about this, but nothing publicly/nightly available: https://github.com/w3c/csswg-drafts/issues/2735

Here’s a stackoverflow with more information: https://stackoverflow.com/a/51799496

1 Like

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.