DEV Community

Discussion on: Create A Dark/Light Mode Switch with CSS Variables

Collapse
 
tomayac profile image
Thomas Steiner

CSS variables are fantastic for use cases like this. Here's a <dark-mode-toggle> that initially respects prefers-color-scheme and allows for manual overrides. Read more about it in this article.