New issue
Advanced search Search tips
Starred by 55 users

Issue metadata

Status: Started
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android , Windows , Chrome , Mac
Pri: 2
Type: Feature

Blocking:
issue 925935
issue 925949



Sign in to add a comment
link

Issue 889087: Add support for CSS prefers-color-scheme media feature

Reported by meriha...@gmail.com, Sep 25

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:62.0) Gecko/20100101 Firefox/62.0

Steps to reproduce the problem:
Try to use prefers-color-scheme media query.

What is the expected behavior?
prefers-color-scheme media query should report the user's preference about the OS color scheme.

What went wrong?
prefers-color-scheme media query is ignored.

Did this work before? No 

Does this work in other browsers? No
 This is a new media query added to CSS Media Queries Level 5 to utilize the dark mode preference operating systems provide.

https://bugzilla.mozilla.org/show_bug.cgi?id=1494034

Chrome version: <Copy from: 'about:version'>  Channel: n/a
OS Version: OS X 10.14
Flash Version: 

Link to spec: https://drafts.csswg.org/mediaqueries-5/#prefers-color-scheme
 

Comment 1 by viswa.karala@chromium.org, Sep 26

Labels: Needs-Milestone

Comment 2 by ajha@chromium.org, Sep 26

Labels: -Type-Bug Type-Feature

Comment 3 by e...@chromium.org, Sep 30

Labels: -Pri-2 Pri-3
Status: Available (was: Unconfirmed)

Comment 4 by jorik@google.com, Oct 31

Support for this has arrived in Safari Technology Preview 68.

Comment 5 by lgrey@chromium.org, Oct 31

Cc: ellyjo...@chromium.org
cc ellyjones@ re: our conversation earlier this week about interaction of dark mode and which system colors we give to Blink

Comment 6 by clshortf...@gmail.com, Nov 11

Might as well branch this out to Windows

Win32 apps listen on:

Software\Microsoft\Windows\CurrentVersion\Themes\Personalize\AppsUseLightTheme

https://blogs.technet.microsoft.com/uktechnet/2016/07/15/13-epic-registry-hacks/

Windows WPF/UWP apps use:

Application.RequestedTheme

https://docs.microsoft.com/en-us/uwp/api/windows.ui.xaml.application.requestedtheme

Comment 7 by futhark@chromium.org, Jan 4

Labels: -Pri-3 Pri-2
Owner: futhark@chromium.org
Status: Assigned (was: Available)

Comment 8 by futhark@chromium.org, Jan 5

Status: Started (was: Assigned)

Comment 9 by futhark@chromium.org, Jan 5

Labels: OS-Android OS-Chrome OS-Windows

Comment 10 by markchang@chromium.org, Jan 9

Cc: markchang@chromium.org

Comment 11 by bugdroid1@chromium.org, Jan 10

Project Member
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/7959d13749d4d965ad6a08767e3d28dabe262d03

commit 7959d13749d4d965ad6a08767e3d28dabe262d03
Author: Rune Lillesveen <futhark@chromium.org>
Date: Thu Jan 10 10:16:28 2019

Support for prefers-color-scheme media feature.

The preferred color scheme can be passed to the renderer through
Settings, but there is no code in content changing it from the default
value yet.

Spec:

https://drafts.csswg.org/mediaqueries-5/#prefers-color-scheme

Intent to Implement:

https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/Muw0N43ntSw

Bug: 889087
Change-Id: I859de2953966640baed57ee6d4a5edcbabf9e999
Reviewed-on: https://chromium-review.googlesource.com/c/1396404
Commit-Queue: Rune Lillesveen <futhark@chromium.org>
Reviewed-by: Chris Harrelson <chrishtr@chromium.org>
Reviewed-by: Eric Willigers <ericwilligers@chromium.org>
Cr-Commit-Position: refs/heads/master@{#621528}
[modify] https://crrev.com/7959d13749d4d965ad6a08767e3d28dabe262d03/third_party/blink/public/BUILD.gn
[add] https://crrev.com/7959d13749d4d965ad6a08767e3d28dabe262d03/third_party/blink/public/platform/web_color_scheme.h
[modify] https://crrev.com/7959d13749d4d965ad6a08767e3d28dabe262d03/third_party/blink/renderer/core/css/css.dict
[modify] https://crrev.com/7959d13749d4d965ad6a08767e3d28dabe262d03/third_party/blink/renderer/core/css/css_value_keywords.json5
[modify] https://crrev.com/7959d13749d4d965ad6a08767e3d28dabe262d03/third_party/blink/renderer/core/css/media_feature_names.json5
[modify] https://crrev.com/7959d13749d4d965ad6a08767e3d28dabe262d03/third_party/blink/renderer/core/css/media_query_evaluator.cc
[modify] https://crrev.com/7959d13749d4d965ad6a08767e3d28dabe262d03/third_party/blink/renderer/core/css/media_query_exp.cc
[modify] https://crrev.com/7959d13749d4d965ad6a08767e3d28dabe262d03/third_party/blink/renderer/core/css/media_values.cc
[modify] https://crrev.com/7959d13749d4d965ad6a08767e3d28dabe262d03/third_party/blink/renderer/core/css/media_values.h
[modify] https://crrev.com/7959d13749d4d965ad6a08767e3d28dabe262d03/third_party/blink/renderer/core/css/media_values_cached.cc
[modify] https://crrev.com/7959d13749d4d965ad6a08767e3d28dabe262d03/third_party/blink/renderer/core/css/media_values_cached.h
[modify] https://crrev.com/7959d13749d4d965ad6a08767e3d28dabe262d03/third_party/blink/renderer/core/css/media_values_dynamic.cc
[modify] https://crrev.com/7959d13749d4d965ad6a08767e3d28dabe262d03/third_party/blink/renderer/core/css/media_values_dynamic.h
[modify] https://crrev.com/7959d13749d4d965ad6a08767e3d28dabe262d03/third_party/blink/renderer/core/css/style_engine_test.cc
[modify] https://crrev.com/7959d13749d4d965ad6a08767e3d28dabe262d03/third_party/blink/renderer/core/frame/settings.h
[modify] https://crrev.com/7959d13749d4d965ad6a08767e3d28dabe262d03/third_party/blink/renderer/core/frame/settings.json5
[modify] https://crrev.com/7959d13749d4d965ad6a08767e3d28dabe262d03/third_party/blink/renderer/platform/runtime_enabled_features.json5
[add] https://crrev.com/7959d13749d4d965ad6a08767e3d28dabe262d03/third_party/blink/web_tests/external/wpt/css/mediaqueries/prefers-color-scheme-expected.txt
[add] https://crrev.com/7959d13749d4d965ad6a08767e3d28dabe262d03/third_party/blink/web_tests/external/wpt/css/mediaqueries/prefers-color-scheme.html

Comment 12 by groby@google.com, Jan 24

Cc: dbeam@chromium.org
+dbeam as a heads-up for WebUI

Comment 13 by markchang@chromium.org, Jan 26

Cc: lgrey@chromium.org robliao@chromium.org
+lgrey and +robliao for primary/secondary UI

Comment 14 by dmazz...@chromium.org, Jan 28

Blockedon: 722548
How does this related to  bug 722548 ? Can we dedup?

Comment 15 by markchang@chromium.org, Jan 28

I don't think that they are related. 889087 should not block 722548, IMO.

Comment 16 by dmazz...@chromium.org, Jan 28

Blockedon: -722548
Sorry, I totally misread the title of 722548. Removing.

Comment 17 by dmazz...@chromium.org, Jan 28

Blocking: 925935

Comment 18 by dmazz...@chromium.org, Jan 28

Blocking: 925949

Sign in to add a comment