- From: Tab Atkins Jr. via GitHub <noreply@w3.org>
- Date: Mon, 21 Jul 2025 17:15:50 +0000
- To: public-css-archive@w3.org
> and allowing an optional <ident> label for each item. Since the values are arbitrary, this is a little hard - you have to be able to tell whether the item contains the label or not. We can maybe handle this with an ident+colon, since you can use a `{...}` wrapper if your value does start with an ident and colon. But I probably would prefer to just do that with a second function that forces all items to have a label. (It could still allow selecting via index, too.) (We have a similar issue in the `*-interpolate()` functions, where we'd like to let people just specify bare values and auto-distribute them like gradient stops, but the grammar is too ambiguous. We're gonna have to keep the colons, with some indicator that the stop is auto-placed, like `auto: foo` or something.) > Percentages would also be incredibly useful, to use scales of values without needing to know the number of items. The percentage would be rounded to the nearest index. ...actually you can already do this, per spec. `random-item(fixed .5, ...)`, given a value between 0 and 1, will select an item from the list with each taking an equal share of the number range, for any number of items. -- GitHub Notification of comment by tabatkins Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/11103#issuecomment-3097650918 using your GitHub account -- Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Monday, 21 July 2025 17:15:51 UTC