3 ms·
You should consider shipping a combined css file that uses the prefers-color-scheme media query to show dark or light as appropriate! https://developer.mozilla
by peter_l_downs 8y ago
You should consider shipping a combined css file that uses the prefers-color-scheme media query to show dark or light as appropriate!
https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme https://developer.mozilla.org/en-US/docs/Web/CSS/@media/pref...
- tobyhinloopen 8y agoI didn’t know this feature but I love it! I’ll try to use it in all future projects
- portroyal 8y agoAlso chiming in to say thanks. I hadn't seen this gem in my MDN browsing either.
- z3t4 8y agoI investigated this a few months ago and no browser, not even Safari supported it. Hopefully more platforms will start to support it.
- stephenr 8y agoSafari supports it as of 12.1 (It was available in the Tech Preview prior to 12.1)
- onion2k 8y agoIt sounds backwards, but this is why you should use this feature. It sends a message to browser vendors (via Chrome Status eg https://www.chromestatus.com/features/5109758977638400 https://www.chromestatus.com/features/5109758977638400) that developers want to use those features, which helps the Chrome team (and other vendors) prioritize what to work on. Build sites to be standards compliant and accessible first, and then progressively enhance them using new browser features to give the user a better experience. It's absolutely the best way to build for the web.
- felixfbecker 8y agoIt's also supported already in Firefox Nightly (macOS and Windows) and WIP in Chrome