light-dark()
The light-dark() CSS function accepts two colors and uses one depending on the current color scheme.
Status
Baseline Newly Available (since 2024-05-13)
This feature is expected to reach Baseline Widely Available status on: 2026-11-13
MDN documentation
Specifications
Browser support
- Chrome 123 Released on 2024-03-19
- Chrome Android 123 Released on 2024-03-19
- Edge 123 Released on 2024-03-22
- Firefox 120 Released on 2023-11-21
- Firefox for Android 120 Released on 2023-11-21
- Safari 17.5 Released on 2024-05-13
- Safari on iOS 17.5 Released on 2024-05-13
Surveys
- State of CSS 2025 > usage > gamechanger feature
- State of CSS 2025 > usage > favorite new features
- State of CSS 2025 > usage > css missing features
- State of CSS 2025 > usage > css interoperability features
- State of CSS 2025 > reading list > reading list
- State of CSS 2025 > features > all features
- State of CSS 2025 > colors > colors pain points
- State of CSS 2024 > usage > favorite new features
- State of CSS 2024 > reading list > reading list
- State of CSS 2024 > features > all features
Usage (according to Chrome Platform Status)
~1.068% of page loads. More data at chromestatus.com.Web Platform Tests (WPT)
View the latest WPT test results for this featureView as JSON | Edit this feature | Report an issue | Web-features entry: source, dist