CSS light-dark() for Images Is Now Baseline Across Browsers

Content is AI-assisted and may contain inaccuracies.

The light-dark() function now covers images and gradients as well as colors, and it reached Baseline status in September 2026 after Safari 27 shipped the remaining support. The practical effect is that a dark-mode asset no longer needs a duplicate rule wrapped in a prefers-color-scheme media query.

Instead, a single declaration selects the light and dark sources, letting CSS resolve the choice. The feature keeps dark-mode styling in one place and removes the media-query boilerplate that previously required.

light-dark

Authors

Sources

Tags