2 posts tagged “JavaScript”

Implementing dark mode, for real this time

I knew the basic theory of implementing a dark mode for my site. Making it actually work was a whole other thing.

Create a dark mode with CSS Variables

CSS custom properties make it trivial to add multiple colour schemes to your project. Here’s a simple way to toggle dark mode with three lines of Javascript.