[csswg-drafts] [css-values-5] Should all interpolation functions have a mixing version? (#11531)

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

== [css-values-5] Should all interpolation functions have a mixing version? ==
In [css-values-5](https://drafts.csswg.org/css-values-5/#mixing) we define `*-mix()` functions (`calc-mix()`, `color-mix()` etc) that **interpolate** rather than mix, i.e. 0% gets you the first color and 100% the second one instead of the way around which is how the mixing version works.

Since `color-mix()` already has a mixing version, its grammar overloads that with the interpolation version:

```
<color-mix()> =
  color-mix( [ <progress> && <color-interpolation-method>? ] , <color>, <color> ) |
  color-mix( <color-interpolation-method>, [<color> && <percentage [0,100]>?]#{2} )
```

However, the rest do not have a mixing version, and *only* define an interpolation versions:

```
<calc-mix()> = calc-mix( <progress>, <calc-sum>, <calc-sum> )
```

Admittedly, "mixing" is much more of an established concept with colors, but I worry this introduces an inconsistency in the language, and hinders learnability for authors. 

Is it worth it to include mixing versions for all of these? It's just syntax sugar, so it doesn't seem to hard to implement.
E.g. `calc-mix()` would become:

```
<calc-mix()> =
  calc-mix( <progress> , <calc-sum>, <calc-sum> ) |
  calc-mix( [<calc-sum> && <percentage [0,100]>?]#{2} )
```

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


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

Received on Saturday, 18 January 2025 21:23:52 UTC