[csswg-drafts] [css-color-5] Make color-contrast() candidates optional (#7345)

LeaVerou has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-color-5] Make color-contrast() candidates optional ==
From https://www.w3.org/TR/css-color-5/#winner

> If there is a target contrast, and the end of the list is reached without meeting that target, either [white](https://www.w3.org/TR/css-color-4/#valdef-color-white) or [black](https://www.w3.org/TR/css-color-4/#valdef-color-black) is returned, whichever has the higher contrast.

However, a lot of the time getting either `black` or `white` is *exactly* what you want. If this is the default behavior, people shouldn't have to do dummy things like `color-contrast(var(--color) vs white, black)` or even `color-contrast(var(--color) vs var(--color), var(--color))` etc, they should just be able to do something like `color-contrast(var(--color))` and get either white or black.

I.e. change the grammar from:

```
color-contrast() = color-contrast( <color> vs <color>#{2,}  [ to [<number> | AA | AA-large | AAA | AAA-large]]? )
```

to:

```
color-contrast() = color-contrast( <color> [ vs <color>#{2,}  [ to [<number> | AA | AA-large | AAA | AAA-large]]? ]? )
```

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/7345 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Thursday, 9 June 2022 14:57:25 UTC