Closed Bug 1576289 Opened 5 years ago Closed 2 years ago

[css-color-adjust-1] Implement color-scheme property

Categories

(Core :: CSS Parsing and Computation, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
96 Branch
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

See Also: → 1525107

Please note https://bugzilla.mozilla.org/show_bug.cgi?id=1626560 that we also just discovered in Chrome.

Chrome
WebKit
Firefox

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.

If it requires changes to the UA sheet, then it should probably be a spec issue.

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).

Blocks: 1642596
Blocks: 1525107
Depends on: 1722299

Tentatively taking this. I'm not starting on it right away, but I'll probably dive into this within a month or so.

Assignee: nobody → dholbert
See Also: → 1731678
Depends on: 1734009
Depends on: 1734115
Depends on: 1739925

There's two kinds of test failures remaining:

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.

Assignee: dholbert → emilio
Pushed by ealvarez@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/7c5a0fa01f7c
Let color-scheme meta tag and property ride the trains. r=dholbert
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 96 Branch
Regressions: 1742462
No longer regressions: 1742462
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: