BrikoX@lemmy.zip to Web Development@programming.devEnglish · 10 days agoYou no longer need JavaScriptlyra.horseexternal-linkmessage-square13fedilinkarrow-up151arrow-down10file-textcross-posted to: technology@lemmy.world
arrow-up151arrow-down1external-linkYou no longer need JavaScriptlyra.horseBrikoX@lemmy.zip to Web Development@programming.devEnglish · 10 days agomessage-square13fedilinkfile-textcross-posted to: technology@lemmy.world
minus-squareEphera@lemmy.mllinkfedilinkEnglisharrow-up8·10 days ago:root { color-scheme: light dark; --text: light-dark(#000, #FFF); --bg: light-dark(#EEE, #242936); } Hmm, I guess the advantage of that over @media (prefers-color-scheme: dark) { /*set different values for variables*/ } is that you can set the color scheme via a button much more easily then. Had to think about that for a moment, because the old way of doing things seemed fine, but that is a pretty good reason, I guess.
:root { color-scheme: light dark; --text: light-dark(#000, #FFF); --bg: light-dark(#EEE, #242936); }
Hmm, I guess the advantage of that over
@media (prefers-color-scheme: dark) { /*set different values for variables*/ }
is that you can set the color scheme via a button much more easily then.
Had to think about that for a moment, because the old way of doing things seemed fine, but that is a pretty good reason, I guess.