Browser dark mode support

Browser dark mode support

Been playing around with adding support for browser dark mode, and as of a few days ago I've implemented it on this website. Adding this wasn't all that difficult, just time-consuming. Over the last few years, I've mostly written CSS using Sass with the SCSS syntax. This had for some reason made me skip past the native support for variables added in CSS3, which looking back on it now was a mistake.

Native CSS variables combined with Sass makes it quite easy to maintain stylesheets with light/dark modes, and when first implemented makes doing changes much faster. Now there's room for quite a bit of improvement to my stylesheets, as some them have grown a bit outdated by now. If the browser supports CSS variables then it also more or less supports CSS grids, so I'm thinking that's the next step. Time will tell if I ever add that to this website, but at some point, I'll be playing around with it to at least learn how it works.

Credits: Photo by Ales Nesetril on Unsplash