(Don’t) Let there be Light
Today, however, I’ve opted to deviate a bit from my principles and introduce some JS to the website. The reason for this is simple: If you take a glance in the top right corner of the page’s header, you’ll most likely see a small lightbulb. Click on it and the page turns from its usual warm yellow colors to a grayish appearance. Click on it again and the process is reversed. And as an added bonus, your browser will remember which one you settled on, so no need to keep switching it on or off.
This was achieved by refactoring the page’s CSS files to use variables instead of using hardcoded values for colors. The dark and light stylesheets simply contain the values for these variables and the JS code just swaps between them as necessary. All of this happens under the hood, all the user sees is a (hopefully) snappy transition between the two.