Now I’ve implemented a dark mode for this site. There is no manual control for it, it uses the “prefers-color-scheme” CSS media query to follow the current operating system setting. If you use a Mac in dark mode, Chrome or Safari should show you this site in dark mode.
Implementing it was fun, as fiddling with this site always is. It’s a good chance to learn new things. In this case, CSS variables were new to me.
The article “prefers-color-scheme: Hello darkness, my old friend” by Thomas Steiner was very helpful. Luckily, for this simple site I could skip over many parts of Thomas’ comprehensive treatment of the considerations.
One of the trickier things in dark mode is adjusting color palettes, but this site pretty much has no colors, so that wasn’t a problem. I did have to be careful to keep the text at sufficiently high contrast ratios.
Here’s how it looks in light mode (the classic, unchanged):
And in dark mode:
A big challenge was re-rendering the star in the upper left. I’ll have to switch from POV-Ray to Blender one of these days...
I don’t use dark mode myself, so I’m not sure if I got the vibe right. Let me know if there’s something I should adjust.