-
Notifications
You must be signed in to change notification settings - Fork 676
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[css-color-6] Make color-contrast() candidates optional #7345
Comments
Adding the So yes, lets update the grammar. Also, we don't say what is returned at the exact luminance where |
Agenda+ so we can resolve soon since this is part of Interop 2022. |
Because the comma is a list separator |
@manuelmeister can you please open another issue about the general syntax of |
Why the 2 in the grammar:
|
So in other words, if there is a target contrast, the minimum list length is zero, and a list of one makes sense. |
The CSS Working Group just discussed
The full IRC log of that discussion<emilio> Subtopic: candidates optional in contrast-color()<fantasai> github: https://github.com//issues/7345 <emilio> fantasai: proposed resolution is that candidates are optional and default to white and black <emilio> una: sounds good, it simplifies the function. We've talked about future-proofing and verbosity I think this is perfect, and I think "I just want good contrast" will be a large use case <TabAtkins> emilio: wht happens if you have one candidate? <TabAtkins> TabAtkins: you just get white/black if you fall off the list <lea> emilio: if that passes, it's returned, otherwise you get white or black <emilio> RESOLVED: Make candidates optional, use white / black if there's no available options that pass the contrast test |
Closed via f5a104b |
"The candidate colors are tested sequentially, from left to right" If there are no explicit candidates, are the candidate colors white, black or black, white? Usually one will be the clear winner but there will be a particular grey level where both give the same (poor) contrast and we want implementations to reliably interop for that color. |
From https://www.w3.org/TR/css-color-5/#winner
However, a lot of the time getting either
black
orwhite
is exactly what you want. If this is the default behavior, people shouldn't have to do dummy things likecolor-contrast(var(--color) vs white, black)
or evencolor-contrast(var(--color) vs var(--color), var(--color))
etc, they should just be able to do something likecolor-contrast(var(--color))
and get either white or black.I.e. change the grammar from:
to:
The text was updated successfully, but these errors were encountered: