DigiNews

Tech Watch by Johan Denoyer

← Back to articles

Dark mode with web standards

Quality: 8/10 Relevance: 9/10

Summary

The article explains how to implement dark mode using the OS preference (prefers-color-scheme) and how to allow per-site overrides with a meta tag and JavaScript, including limitations where color-scheme does not override OS preferences in all contexts. It also covers how color-scheme interacts with SVG and iframes, caveats on Safari, and the new light-dark() support.

🚀 Service construit par Johan Denoyer