[csswg-drafts] [css-values-5] Can we make input positions optional in *-interpolate(), like in gradients? (#12346)

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

== [css-values-5] Can we make input positions optional in *-interpolate(), like in gradients? ==
In gradients or `linear()`, you don't need to specify any of the color stop positions. The first defaults to 0%, the last to 100%, and anything else gets equally spread out between their surrounding specified positions.

Currently, the *-interpolate() functions don't allow this, because it's not clear how we want to write the grammar for it. Each "stop" is written as `<input-position>{1, 2} : <output-value>`, so merely omitting the position would make it look like:

```css
width: calc-interpolate(75%,
  : 200px,
  : 500px,
  : 1000px );
```
...which looks pretty weird, imo. (This would be equivalent to `0: 200px, .5: 500px, 1: 1000px`.)

For everything but `interpolate()` itself, it's just fine grammatically to omit the position and colon entirely, like `calc-interpolate(75%, 200px, 500px, 1000px). But `interpolate()`'s outputs are `<whole-value>`, which can theoretically contain colons. However, we already have to use the {}-wrapping for outputs that include commas; we could rely on that here too.

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


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

Received on Monday, 16 June 2025 21:12:24 UTC