Light and dark mode in just 14 lines of CSS - DEV Community π©βπ»π¨βπ»
Fri May 13 2022 04:37:41 GMT+0000 (Coordinated Universal Time)
Saved by @itsbrex
I also use CSS custom properties this way, tho I tend to do one extra step and I have one custom property for dark, one for light, and then I set the ones for dark theme. Kinda like this: What I love about using custom properties in general, is that doesn't require JS, but if you want to use JS, you still can. You just update the custom properties values π Great post as usual, Salma! Cheers!
https://dev.to/whitep4nth3r/light-and-dark-mode-in-just-14-lines-of-css-424e
Comments