CSS light-dark() now swaps images based on color scheme
The CSS light-dark() function now accepts images as well as colors, picking one of two arguments based on the element's color-scheme. As of September 14, 2026 it works in Chrome, Edge, Firefox and Safari, reaching Baseline newly available status.
- light-dark() takes two images or none and picks by the element's color-scheme
- Supported in Chrome and Edge 150, Firefox 150 and Safari 27
- Each side takes a single image; layers need separate calls
- Works with list-style-image as well as background-image
Read next
Software