Media Queries: inverted-colors feature
- Category
- CSS
- Type
- New or changed feature
- Status
- In development (Chrome In development)
- Intent stage
- None
WPT details: https://wpt.fyi/results/css/mediaqueries/inverted-colors.html
Summary
Adds the `inverted-colors` media feature, an indication that the user agent or underlying operating system has forcibly inverted all colors, not a request to do so. This is sometimes provided as a simple accessibility feature, allowing users to switch between light-on-dark and dark-on-light text. Valid options are 'inverted' or 'none'.
Motivation
This is an indication that the user agent or underlying operating system has forcibly inverted all colors, not a request to do so. This is sometimes provided as a simple accessibility feature, allowing users to switch between light-on-dark and dark-on-light text. However, this has unpleasant side effects, such as inverting pictures, or turning shadows into highlights, which reduce the readability of the content. This feature will allow authors to counteract this.
Standards & signals
- Specification: https://drafts.csswg.org/mediaqueries-5/#inverted
- Firefox: No signal — There is a separate umbrella issue for some the preference media queries (contrast, motion, color-scheme). They have a stale PR to add an overall positive position for those preference media queries. They also have an implementation of inverted-colors behind a flag.
- Safari: Shipped/Shipping
- Web developers: Positive
- Tracking bug: http://crbug.com/1462210
Ecosystem
- Web Platform Tests: https://wpt.fyi/results/?q=css%2Fmediaqueries%2Finverted-colors
- Chrome Platform Showcase: https://chrome-platform-showcase.paulkinlan-ea.deno.net/features
- GenDN reference: https://gendn.paulkinlan-ea.deno.net/features
- chrome.dev demos search: https://www.google.com/search?q=site%3Achrome.dev+Media%20Queries%3A%20inverted-colors%20feature
- MDN Web Docs: https://developer.mozilla.org/en-US/search?q=Media%20Queries%3A%20inverted-colors%20feature
- Baseline status: https://webstatus.dev/?q=Media%20Queries%3A%20inverted-colors%20feature
Samples: https://developer.mozilla.org/en-US/docs/Web/CSS/@media/inverted-colors#examples