2 ms·
CSS variables are the best way to do dark mode, just use the variable everywhere, set it on html or :root, and change it either in .darkmode or a @media for dar
by sdegutis 6y ago
CSS variables are the best way to do dark mode, just use the variable everywhere, set it on html or :root, and change it either in .darkmode or a @media for dark mode. They're pretty much supported everywhere dark mode is. Surprisingly simple dark mode support for greenfield sites.
- saagarjha 6y agoIf you don't have much styling, then even :root { color-scheme: light dark; } can get you quite far.