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

Flagging for the agenda for two reasons. One was to discuss the keywords (but that's https://github.com/w3c/csswg-drafts/issues/13601). The other was to re-open the discussion we just resolved, about whether `random(--foo)` is fully global or element-local, after thinking about it more.

The two proposals we've considered here: 
* Old (Tab) proposal: `random(--foo)` is element scoped, and authors can expand that by applying modifier keywords.
* New (Bramus) proposal: `random(--foo)` is fully global, and authors can limit it by applying modifier keywords.

Note that there are several levels of scoping that we can apply to the name:
- Property scoping. (This is easy for the author to do manually, actually, but nice to have.
- Element scoping. (This is something we need to provide a control for.)
- Shadow scoping. (This is something we haven't discussed.)

Reasons why we might want to stick with the old proposal:
- Author is less likely to accidentally create a naming clash, because they'd have to opt in to greater scopes.
- Matches WebKit's existing implementation of the spec, which is starting to get traction.
- Element-scoped values aren't that unusual, for example variables have a value per element, so it's not clear to me that making the name fully global is necessarily more natural?

Reasons why we would want to stick with the new proposal:
- If there's a strong feeling that defaulting names to global scope is much more intuitive. But then we have to decide what it means wrt shadow-crossing.

Reasons not to keep exactly the old proposal: `element-shared` is a terrible confusing name, and we should definitely 100% rename it. My proposal on this front is `cross-element` (which, like `cross-origin`, is about sharing information across scopes). That also allows a straightforward extension to e.g. `cross-shadow` if we need it.

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


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

Received on Wednesday, 1 April 2026 16:34:56 UTC