DEV Community

Discussion on: Adding a dark theme to your website with css variables

Collapse
 
aleksandrhovhannisyan profile image
Aleksandr Hovhannisyan

It's admittedly difficult and leads to a lot more styling than you probably need for your site.

On my dev website (shameless plug), the dark mode theme uses CSS custom properties for most things.

There are, however, certain situations where I'd rather not create a custom property. In those cases, I have a themed SCSS mixin that lets me pass in the property name, the light mode color, and the dark mode color.

Also, finding the right color combinations is a royal PITA.