#color-scheme

[ follow ]
fromCSS-Tricks
1 week ago

Should the CSS light-dark() Function Support More Than Light and Dark Values? | CSS-Tricks

If you don't know, the light-dark() function takes two color arguments: one for light mode and one for dark mode. Hence, the name light-dark(). It toggles between the two light and dark values based on a user's preferences. Sara Joy has a wonderful article where you can get a much more detailed explanation. The key thing is that the function requires you to use the color-scheme property to activate those two color modes: :root { color-scheme: light dark; } .element { color: light-dark(brown, black); }
Web development
#interior-design
[ Load more ]