Implement CSS contrast-color() function
Categories
(Core :: CSS Parsing and Computation, enhancement)
Tracking
()
People
(Reporter: 709922234, Assigned: jfkthame)
References
(Depends on 1 open bug, Blocks 3 open bugs, )
Details
(Keywords: dev-doc-complete, Whiteboard: [platform-feature], [wptsync upstream])
User Story
web-feature: contrast-color
Attachments
(2 files)
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:85.0) Gecko/20100101 Firefox/85.0
Comment 1•5 years ago
|
||
Bugbug thinks this bug should belong to this component, but please revert this change in case of error.
Updated•4 years ago
|
Comment 3•3 years ago
•
|
||
It was resolved today to rename this function to contrast-color(). So renaming this bug as well.
(Also, the function got postponed to level 6 of the specification, though there is no draft yet so keeping it at level 5 for now.)
Sebastian
Comment 4•3 years ago
|
||
(In reply to Sebastian Zartner [:sebo] from comment #3)
(Also, the function got postponed to level 6 of the specificaction, though there is no draft yet so keeping it at level 5 for now.)
There is a draft of css-color-6: drafts.csswg.org/css-color-6. I guess the CSSWG just forgot to link it in their drafts overview (drafts.csswg.org). You can actually find it at the bottom of the drafts overview under "Other Documents".
Comment 5•3 years ago
|
||
Thanks for the hint, Benjamin! I've also asked the CSSWG to add it to the specifications list.
Sebastian
color-contrast() has been renamed to contrast-color() and syntax changed.
https://github.com/w3c/csswg-drafts/issues/7557
https://drafts.csswg.org/css-color-6/#resolving-contrast
Comment 7•3 years ago
|
||
(In reply to Woody Li from comment #6)
color-contrast() has been renamed to contrast-color()
Yes, I mentioned that earlier.
and syntax changed.
And the syntax discussion is still not finished, see https://github.com/w3c/csswg-drafts/issues/7937.
Sebastian
Updated•2 years ago
|
Updated•2 years ago
|
Updated•4 months ago
|
Updated•4 months ago
|
| Assignee | ||
Comment 8•4 months ago
|
||
This implements the contrast-color() function from CSS Color 5
(https://drafts.csswg.org/css-color-5/#contrast-color).
The extended version proposed in CSS Color 6 is not sufficiently well spec'd
to consider implementing at this time.
Updated•4 months ago
|
| Assignee | ||
Comment 9•4 months ago
|
||
Comment 10•4 months ago
|
||
Making this block CSS Color 5 again instead of level 6. Once implemented, this needs to be documented. So adding the dev-doc-needed flag. It should also be mentioned in the dev and general release notes.
Release Note Request (optional, but appreciated)
[Why is this notable]: New CSS function for automatically choosing a contrasting color.
[Affects Firefox for Android]: yes
[Suggested wording]: Firefox now supports the contrast-color() CSS function that takes a color value and returns a contrasting color. Note that the specification currently restricts the contrasting color to black or white. This limitation is expected to be removed in the future.
[Links (documentation, blog post, etc)]:
https://developer.mozilla.org/en-US/docs/Web/CSS/color_value/contrast-color
https://drafts.csswg.org/css-color-5/#contrast-color
Sebastian
Comment 11•4 months ago
|
||
Comment 12•4 months ago
|
||
Comment 14•4 months ago
|
||
Reverted this because it was causing mochitests failures in test_bug877690.html.
- Revert link
- Push with failures
- Failure Log
- Failure line: TEST-UNEXPECTED-FAIL | layout/inspector/tests/test_bug877690.html | property color's values.
| Assignee | ||
Comment 15•4 months ago
|
||
Yeah, I saw this -- we just need to update that test to include the new function name.
Comment 16•4 months ago
|
||
Comment 17•4 months ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/ee8f95160b26
https://hg.mozilla.org/mozilla-central/rev/82b99fe4af59
Comment 19•4 months ago
|
||
Added to 146 release notes https://www.firefox.com/en-US/firefox/146.0a1/releasenotes/
Updated•3 months ago
|
Updated•11 days ago
|
Updated•11 days ago
|
Description
•