-
“I considered using
prefers-color-scheme[…], but decided a toggle would probably be better. Browser support for the color theme preference query isn’t that great yet, plus devs are weird.”—@claviska in quoted tweet. THAT’s why I made <dark-mode-toggle> web.dev/prefers-color-scheme/#dark-mode-but-add-an-opt-out x.com/css/status/1152320795135401987 -
@css @claviska It initially respects
prefers-color-schemeprefs, allows for overriding them (“devs are weird”), and—as a bonus 🎁—handles the case where browsers don’t understand the media query in a future proof way. Demo: googlechromelabs.github.io/dark-mode-toggle/demo/index.html Code: github.com/GoogleChromeLabs/dark-mode-toggle