Closed Bug 1722031 Opened 3 years ago Closed 3 years ago

Ship accent-color

Categories

(Core :: CSS Parsing and Computation, task)

task

Tracking

()

RESOLVED FIXED
92 Branch
Tracking Status
firefox92 --- fixed

People

(Reporter: emilio, Assigned: emilio)

References

(Blocks 1 open bug)

Details

(Keywords: dev-doc-complete)

Attachments

(3 files, 1 obsolete file)

No description provided.

The accent-color computation right now chooses between black and white,
which is not ideal.

I tried to make it so that authors could choose the foreground colors in
the linked CSSWG issue from the comment, but that didn't go anywhere.

I think choosing a contrasting color that is in-line and contrasting
enough with the accent-color chosen by the page when darkening is better
than just black or white.

If we want the black-or-white behavior we can just change
layout.css.accent-color.target-contrast-ratio to something large enough.

https://accent-color.glitch.me/ is a nice playground to see this patch
in action.

Depends on D120722

Attachment #9232849 - Attachment is obsolete: true

No other property returns currentcolor in the computed style, and
Chrome agrees with us on this test.

Pushed by ealvarez@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/2a0274aa4014
Fix an accent-color test. r=mstange
Pushed by ealvarez@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/ef0ebe9d47b3
Fix RelativeLuminanceUtils::Adjust to not choke on blacks / zero components. r=mstange
https://hg.mozilla.org/integration/autoland/rev/7a7d9a6cc513
Tweak accent-color foreground computation and let it ride the trains. r=mstange
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/29776 for changes under testing/web-platform/tests
Upstream PR merged by moz-wptsync-bot

I've updated BCD and release notes: https://github.com/mdn/content/issues/7752

No longer blocks: css-ui-3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: