Re: [csswg-drafts] [css-values] Proposal: `round()` to a finite scale (#11067)

I think there is value in having a way to describe lists of numbers and pass them around, and maybe in the future even — gasp — get elements by index, and this could pave the way.

Also, I don't think we need a new rounding function. Conceptually this still fits nicely within `round()` — just instead of rounding to a multiple of a certain value, you are rounding to whatever is closest in a list of numbers. If anything, the current syntax could be seen as sugar that generates an infinite list (and I agree infinite lists would be a nice feature, but for later).

There's the open question of whether all lists should live under the same function, with an argument for the type of values:

```
<number-list> = list(of number, <number>#)
```

Which would then allow expanding it to allow combining different values, or a dedicated function:

```
<number-list> = number-list(<number>#)
```
or
```
<number-list> = numbers(<number>#)
```

And then `round()` becomes:

```
<round()> = round( <rounding-strategy>?, <calc-sum>, [ <calc-sum> | <number-list>]?)
```



-- 
GitHub Notification of comment by LeaVerou
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/11067#issuecomment-2436351880 using your GitHub account


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

Received on Thursday, 24 October 2024 21:16:07 UTC