automatic dark mode on your website without fuss
Forget the bullshit with light switches and weird toggles on your site with two snippets of code, one goes in your <head> tag:
<meta name="supported-color-schemes" content="light dark">
and the other in your stylesheet:
:root {
color-scheme: light dark
}
For extra credit, set your theme colour, which (in supported browsers) also sets your browser chrome to the specified colour:
<meta name="theme-color" content="#fff" media="(prefers-color-scheme: light)">
<meta name="theme-color" content="#000" media="(prefers-color-scheme: dark)">
My blog does not host comments. If you want to discuss a post, or say hello, you can hit me up on BlueSky where I'm @ThomasChatting.dev or you can email me at hello (at) thomaschatting (dot) dev.