Closed Bug 1576289 Opened 4 years ago Closed 1 year ago

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


(Core :: CSS Parsing and Computation, enhancement)

Not set



96 Branch
Tracking Status
firefox96 --- fixed


(Reporter: sebo, Assigned: emilio)


(Blocks 1 open bug)


(Keywords: dev-doc-complete)


(1 file)

This bug is meant to cover the implementation of the color-scheme CSS property introduced in CSS Color Adjustment 1.


See Also: → 1525107

Please note 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.

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
Let color-scheme meta tag and property ride the trains. r=dholbert
Closed: 1 year 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.