CSS light-dark()
January 22, 2025
light-dark() makes it easy to build websites that respect the user’s preferred color scheme while also providing the ability to override the color scheme without code duplication. Be sure to check out the demo at the bottom! Before we dive into light-dark(), let’s take a quick detour to understand color-scheme.
Mayank gives us an easy standards based way to do light/dark themed web sites and talks a bit about the CSS color-scheme
property.