-
Notifications
You must be signed in to change notification settings - Fork 756
Description
As we move towards a color-contrast() function that is more flexible and allows specifying the algorithm used (see #7356), we run into the issue that many (most?) contrast algorithms are not commutative operations; it makes a difference which of the two colors is background and which one is foreground. Currently, color-contrast() does not distinguish between the two, but we think the syntax should make it clear which one is which.
While the most common case is to provide a fixed background color and multiple candidates for the foreground color, we think the reverse should be possible as well (fixed foreground, variable background). We do not think there are enough use cases that warrant the complexity of providing multiple candidates for both.
@fantasai suggested the following syntax, which also addresses the syntax concerns raised in #7354: color-contrast([over | under] <color>, <color>#) (target level omitted from this grammar for simplicity)
(Issue filed following breakout discussions between @svgeesus, @fantasai, @argyleink and myself)
Metadata
Metadata
Assignees
Labels
Type
Projects
Status