Skip to content

[css-color-5] color-contrast needs another comma #5087

Closed
@tabatkins

Description

@tabatkins

The color-contrast() function 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>#  )

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions