Intent to Ship: Media Queries: prefers-color-scheme feature

313 views
Skip to first unread message

Rune Lillesveen

unread,
May 2, 2019, 8:11:07 AM5/2/19
to blink-dev
fut...@chromium.org N/A https://drafts.csswg.org/mediaqueries-5/#prefers-color-scheme Support the media query feature 'prefers-color-scheme' from Media Queries Level 5 to let authors adapt web content to user-selected themes in the OS or browser. For instance by selecting dark instead of light appearance in MacOS. Keywords: 'light', 'dark', 'no-preference'. https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/Muw0N43ntSw/discussion
Both Safari and Firefox ships this feature. Firefox: In development (https://bugzilla.mozilla.org/show_bug.cgi?id=1494034) Will ship in Firefox 67 Edge: No public signals Safari: Shipped (https://webkit.org/blog/8475/release-notes-for-safari-technology-preview-68/) Shipped in Safari 12.1 Web developers: No signals This feature will be used together with color-scheme property and meta value from https://drafts.csswg.org/css-color-adjust-1/. However, it does not rely on those features being shipped and should not cause issues when/if they are shipped. This feature can be used for fingerprinting as it exposes a user preference. Security/privacy people have been contacted for heads-up/pre-approval before sending this intent-to-ship.
Yes, but see below for details:

In short, the feature itself will be supported, but what it evaluates to may vary between platforms and their ability to let the user change the theme.
Supported in Chrome via system setting on Android Q, MacOS, Windows, and via --force-dark-mode on other platforms. There is also a setting in Chrome for Android to override the system setting.

For Android WebView, the 'prefers-color-scheme' media feature will match 'no-preference' when forced darkening is enabled to not have the web content apply dark styles before automatic darkening is applied. See https://developer.android.com/reference/android/webkit/WebSettings.html#setForceDarkMode(int)
No, there are no integration tests with the OS/Browser setting for web-platform-tests. That integration is tested specifically for Chromium in browser tests.



Thomas Steiner

unread,
May 2, 2019, 8:18:02 AM5/2/19
to Rune Lillesveen, blink-dev
On Thu, May 2, 2019 at 2:11 PM Rune Lillesveen <fut...@chromium.org> wrote:
fut...@chromium.org N/A https://drafts.csswg.org/mediaqueries-5/#prefers-color-scheme Support the media query feature 'prefers-color-scheme' from Media Queries Level 5 to let authors adapt web content to user-selected themes in the OS or browser. For instance by selecting dark instead of light appearance in MacOS. Keywords: 'light', 'dark', 'no-preference'. https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/Muw0N43ntSw/discussion
Both Safari and Firefox ships this feature. Firefox: In development (https://bugzilla.mozilla.org/show_bug.cgi?id=1494034) Will ship in Firefox 67 Edge: No public signals Safari: Shipped (https://webkit.org/blog/8475/release-notes-for-safari-technology-preview-68/) Shipped in Safari 12.1 Web developers: No signals

I think it's fair to say that there is significant developer interest: https://medium.com/dev-channel/let-there-be-darkness-maybe-9facd9c3023d.

Rune Lillesveen

unread,
May 2, 2019, 8:52:08 AM5/2/19
to Thomas Steiner, blink-dev
On Thu, May 2, 2019 at 2:17 PM Thomas Steiner <to...@google.com> wrote:


On Thu, May 2, 2019 at 2:11 PM Rune Lillesveen <fut...@chromium.org> wrote:
Web developers: No signals

I think it's fair to say that there is significant developer interest: https://medium.com/dev-channel/let-there-be-darkness-maybe-9facd9c3023d.

Sorry, that was sloppy of me.

Chris Harrelson

unread,
May 2, 2019, 10:32:00 AM5/2/19
to Rune Lillesveen, Thomas Steiner, blink-dev
This intent is just adding a new type of media query, and is already shipped/shipping in two other browsers, so I think a TAG review is not necessary.

LGTM1

--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CACuPfeRvn4MJhNnvU4du9xq%2B81b%2BoPKKxiRPZgikffMEH5D5Ng%40mail.gmail.com.

Yoav Weiss

unread,
May 2, 2019, 11:33:52 AM5/2/19
to Chris Harrelson, Rune Lillesveen, Thomas Steiner, blink-dev

Daniel Bratell

unread,
May 2, 2019, 12:27:21 PM5/2/19
to Chris Harrelson, Yoav Weiss, Rune Lillesveen, Thomas Steiner, blink-dev
LGTM3

/Daniel
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CACj%3DBEh29a_HCguOdsqShc9-Pw1C2j1MzWSDu%3DURG_F6mow9rg%40mail.gmail.com.



--
/* Opera Software, Linköping, Sweden: CET (UTC+1) */
Reply all
Reply to author
Forward
0 new messages