W3C home > Mailing lists > Public > public-css-archive@w3.org > May 2020

[csswg-drafts] [css-color-5] color-contrast needs another comma (#5087)

From: Tab Atkins Jr. via GitHub <sysbot+gh@w3.org>
Date: Tue, 19 May 2020 19:09:00 +0000
To: public-css-archive@w3.org
Message-ID: <issues.opened-621218129-1589915339-sysbot+gh@w3.org>
tabatkins has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-color-5] color-contrast needs another comma ==
The [color-contrast() function](https://drafts.csswg.org/css-color-5/#colorcontrast) is defined with the grammar:

```
color-contrast() = color-contrast( <color>  <color>#  )
```

This produces the odd (to my eyes) usage like `color-contrast(wheat tan, sienna)`; the lack of a comma between wheat and tan looks very strange!

This sort of "space-separate some initial values from a comma-separated list" grammar *only* shows up in the 'font' shorthand, where it's also weird and confusing; other places where this sort of grammar happens, like gradients, we instead separate the initial stuff from the list-valued stuff with another comma. While this isn't strictly required for parsing, it makes the function read much better.

So the grammar should instead be:

```
color-contrast() = color-contrast( <color> , <color>#  )
```

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/5087 using your GitHub account
Received on Tuesday, 19 May 2020 19:09:05 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:42:06 UTC