Re: [csswg-drafts] [css-values-5] Maybe min, max and step should not be part of the random-caching-key (#11742)

I inverted the keyword for two reasons:
1. When writing the examples, the progression from "most random" to "most shared" now had a weird curve - omitting the key got you the most randomness, adding *one* value to the key suddenly flipped you to the *least* randomness, then adding *two* values put you back in the middle.
2. The caching key has two components: a name (either manually specified or auto-generated), and an optional element ID (either present or null).  This suggests a 2x2 matrix of possibilities, but only three of them were specifiable with the `per-element` keyword: auto name and ID, manual name and ID, or manual name and null. Inverting the keyword gave you all four.

> The match-element behavior feels inverted to me (at least when you compare it to the VT match-element). match-element uses the element identity as key in VT, in random() it stops using the element identity as key...

In both cases it causes the style to *match* between some context-specific notion of *elements* - in this case, it causes elements to *match* their element-specific IDs together (setting them all to null, but that is indeed matching). It's also closely related in semantics to the `match-parent` keyword used by a few properties, which causes elements to all adopt the same value from their parent rather than use individual values. In this case, it's causing elements to all adopt the same random value from the style rather than use individual values.

I'm open to other names, as we said in the comment, but it needs to be something that clearly expresses the behavior to the author, rather than something that's meaningful only with respect to the internal mechanics of the caching key.

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


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

Received on Saturday, 8 March 2025 16:10:50 UTC