Re: [csswg-drafts] [css-values-5] The `<random-value-sharing>` options for `random()` are confusing (#13132)

> I'm not following the diagrams. What happens with different indexes in the same property? What does "different within an element, can use --foo to subdivide" mean?

The property+usage value in the caching key is unchanged. I'm just playing with how exactly we null that out.

And by subdivide, I mean that `width: random(per-property, 100px, 200px)` will use the same value for *all* widths across the document (including multiple uses in a single width, since it's nulling out the property+usage key entirely); if you want to make a group of *some* elements that share a random width, or get multiple random values in a single property to be different, you can also pass an ident, like `width: random(--foo per-property, ...);`. This'll be different from the first random width, or a random width with a different keyword, etc.

In the spec's caching-key terminology, the first one has a key of `(null, "width 0", element ID)`, while the second has a key of `("--foo", null, element ID)`.

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


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

Received on Wednesday, 4 February 2026 22:13:16 UTC