BrikoX@lemmy.zip to Web Development@programming.devEnglish · 8 days agoYou no longer need JavaScriptlyra.horseexternal-linkmessage-square16fedilinkarrow-up164arrow-down10file-textcross-posted to: [email protected][email protected]
arrow-up164arrow-down1external-linkYou no longer need JavaScriptlyra.horseBrikoX@lemmy.zip to Web Development@programming.devEnglish · 8 days agomessage-square16fedilinkfile-textcross-posted to: [email protected][email protected]
minus-squareEphera@lemmy.mllinkfedilinkEnglisharrow-up9·8 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.