[css-color-adjust-1] Implement color-scheme property
Categories
(Core :: CSS Parsing and Computation, enhancement)
Tracking
()
Tracking | Status | |
---|---|---|
firefox96 | --- | fixed |
People
(Reporter: sebo, Assigned: emilio)
References
(Blocks 1 open bug)
Details
(Keywords: dev-doc-complete)
Attachments
(1 file)
This bug is meant to cover the implementation of the color-scheme
CSS property introduced in CSS Color Adjustment 1.
Sebastian
Comment 2•5 years ago
|
||
Please note https://bugzilla.mozilla.org/show_bug.cgi?id=1626560 that we also just discovered in Chrome.
Since this probably requires changes to the user agent stylesheets, it would be great to agree on a cross-browser set of dark scheme default link colors.
Assignee | ||
Comment 3•5 years ago
|
||
If it requires changes to the UA sheet, then it should probably be a spec issue.
Comment 4•5 years ago
|
||
If someone wants to give this a shot, I think the implementation would probably go somewhere like this:
- Make the style system understand/parse the color-scheme property
- In the each widget, use the color-scheme info to switch between light/dark widgets, nsNativeBasicTheme or GTK might be the easiest ones to start with.
- Update the system colors to change based on the color-scheme info. I don't think an internal function (
-internal-light-dark-color(black, white)
) like Chromium does is appropriate for this, since Gecko supports custom document colors, so a binary function isn't exhaustive.
It might also be worth updating the preferences UI for document colors to also include dark theme color settings (also worth looking at how this should work with forced colors mode).
Comment 6•3 years ago
|
||
Tentatively taking this. I'm not starting on it right away, but I'll probably dive into this within a month or so.
Assignee | ||
Comment 8•3 years ago
|
||
There's two kinds of test failures remaining:
-
Failures related to how system colors inherit, which is something
that no engine is shipping and I'm not convince it's a good thing:
https://github.com/w3c/csswg-drafts/issues/6773 -
Failures related to <iframes> observing color-scheme of ancestors
(which Chrome does implement but Safari doesn't):
https://github.com/w3c/csswg-drafts/issues/4772
https://bugzilla.mozilla.org/show_bug.cgi?id=1738380
I'm unconvinced that should work across cross-origin iframes though
(see the question at the end of that issue), and it seems delaying
shipping it blocked on figuring that out while other engines ship
diverging behaviors is probably not worth it.
Given privileged code is already using this and we know of no other
blockers, I think it's fine to let it ride the trains.
Updated•3 years ago
|
Comment 10•3 years ago
|
||
bugherder |
Description
•