- From: Tab Atkins Jr. via GitHub <noreply@w3.org>
- Date: Mon, 16 Jun 2025 21:12:23 +0000
- To: public-css-archive@w3.org
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