The CSS `light-dark()` color function lets you define two color values for a property — one for light mode and one for dark mode — without needing `prefers-color-scheme` media queries. It requires setting `color-scheme: light dark` on the target element (typically `html`) to activate. You can also force a specific scheme on individual elements by setting `color-scheme: dark` or `color-scheme: light` directly. Code examples show how to use CSS custom properties with `light-dark()` for background and text colors.
1 Impression