DEV Community

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

Collapse
 
rugk profile image
rugk

You won't believe it, but actually you can nowadays even take the operation system setting for the dark mode and apply/get that, so your users don't even need that toggle, or at least use the version they prefer, by default.
With CSS and JS


Collapse
 
deschainxu profile image
DeschainX 𓅓

In my case, I would offer two toggle for users which are auto mode (system dark mode) and manual Light/Dark toggle, so users can choose whatever they prefer.