DEV Community

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

Collapse
 
feldev profile image
Félix Paradis • Edited

Just added mine over at felixparadis.com :)

Quick note about accessibility though:
If you just display:none; your input, you're making it unaccessible through keyboard navigation.
Just hide it behind the label instead and everyone can toggle 🎉
Then add aria-label="Switch visual theme" to your input and blind users can know what's it about.