- From: Brandon McConnell via GitHub <sysbot+gh@w3.org>
- Date: Mon, 19 Jun 2023 15:02:52 +0000
- To: public-css-archive@w3.org
@ShayDavidson I've specifically been considering the use case of a seed PLUS an index/nth value for unique values per sibling as well. The `per-element` keyword might cover that use case as well, as far as ensuring that each sibling's value is unique, but to make the seed values reliable and reproducible, something like this would be useful: ```css #some-id :nth-child(odd) { --ident: [static-text] sibling-index(); --random-value: random(--ident, 0px, 100px, by 1); width: var(--random-value); } ``` Here, we are building the custom ident using any arbitrary ident-like string as well as another type such as the `sibling-index()` which would be a number. >The addition of `sibling-index()` is already being discussed in #4559. I'm simply pointing out how it could be useful in building unique sibling-index-based idents for use in `random()`. Hypothetically, you can use as many parts inside one of these idents as you like, similar to how in some keyed blocks in JS, you can build the key like this: ``` (`${category}-${type}-${focus}`) ``` -- GitHub Notification of comment by brandonmcconnell Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/2826#issuecomment-1597345133 using your GitHub account -- Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Monday, 19 June 2023 15:02:54 UTC