Intent to Prototype: inverted-colors media query

88 views
Skip to first unread message

Luke

unread,
Jul 25, 2023, 3:08:10 PM7/25/23
to blin...@chromium.org

Contact emails

dmaz...@chromium.orgabox...@chromium.orglukewa...@gmail.com

Explainer

None

Specification

https://drafts.csswg.org/mediaqueries-5/#inverted

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. This specifically should match classic invert where ALL colors are inverted. Valid options are 'inverted' or 'none'.



Blink component

Blink>Accessibility

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 (the UA stylesheet will handle image/video inversion)



Initial public proposal

https://github.com/w3c/csswg-drafts/issues/732

Search tags

cssinverted-colors

TAG review

None

TAG review status

Pending

Risks



Interoperability and Compatibility

None



Gecko: No signal (https://github.com/mozilla/standards-positions/issues/853) 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 a partial implementation of inverted-colors behind a flag.

WebKit: Shipped/Shipping (http://trac.webkit.org/browser/trunk/LayoutTests/fast/media/mq-inverted-colors.html?order=name)

Web developers: Positive (https://blog.logrocket.com/new-media-queries-you-need-to-know#:~:text=at%20MDN.-,inverted%2Dcolors,-Before%20the%20time)

Other signals:

Security

This feature can be used for fingerprinting as it exposes a user preference.



WebView application risks

Does this intent deprecate or change behavior of existing APIs, such that it has potentially high risk for Android WebView-based applications?

None



Debuggability

Due to a reliance on color inversion this may be tricky to debug without access to a platform with a supported setting. Emulation in dev tools could be added but it wouldn't be as useful as other emulations as it wouldn't properly emulate the rendering state.



Is this feature fully tested by web-platform-tests?

Yes

Flag name on chrome://flags

None

Finch feature name

None

Non-finch justification

None

Requires code in //chrome?

False

Tracking bug

http://crbug.com/1462210

Estimated milestones

No milestones specified



Link to entry on the Chrome Platform Status

https://chromestatus.com/feature/5940010603773952

This intent message was generated by Chrome Platform Status.
Reply all
Reply to author
Forward
0 new messages