Supporting dark mode usually meant defining one set of custom properties for light under `:root`, another for dark under `:root.dark` or `@media (prefers-color-scheme: dark)`, then referencing them indirectly through a single `var(--bg)`. With many tokens, that duplication adds up.
`light-dark(#fff, #111)` states both values inline — "this in light mode, that in dark mode." It only works once `color-scheme: light dark` is declared on the element or an ancestor; without it, the browser always uses the first (light) value.
Check caniuse/MDN baseline for support. Without it, the familiar `:root`/`.dark` custom-property duplication remains the fallback.
When to use
Collapsing dark-mode color tokens into a single declaration — a good fit for component libraries with few tokens.