To all No-CSS webmasters : you can still respect your readers light/dark mode preference with this simple line :
<meta name="color-scheme" content="light dark">
<meta name="color-scheme" content="light dark">
My page uses a minimalistic CSS and only changes the colors for syntax highlighting -- which is now slightly broken in the dark mode but probably still an improvement over the white background for those people who want the dark mode :)
might be of use:
@supports (color-scheme: dark light) {
@media screen and (prefers-color-scheme: dark) {
code { ... }
}
}worth noting, browsers also treat the default dark mode background colors differently: chrome uses black, safari uses dark gray, and firefox uses dark navy