-
Notifications
You must be signed in to change notification settings - Fork 779
Description
In #13132 we resolved to change how the random functions' caching key controls work, switching to a name-based model instead to better match author intention. That is:
random(1, 10)is max-random: virtually every instance on the page will be a different random valuerandom(--foo, 1, 10)is min-random: every function that uses--foowill get the same random value
If you supply a dashed-ident name, you can also specify keywords that "mix in" certain aspects of the usage into the name to make it a little more unique, giving you intermediate-level randomness where some instances share the random value but others don't.
Per the resolution (and per the spec in a bit when I edit it in), the current keywords are:
random(--foo element, 1, 10)mixes in an element identifier, so usages on an element will all share the random value, but different elements will get different valuesrandom(--foo property, 1, 10)mixes in the property name, so usages in a single property will share the random value (still global across elements), but using it in different properties gives a different valuerandom(--foo property index, 1, 10)mixes in the property name and the random function's index in the property, so multiple usages even in the same property will get different values.
(You can also mix them; random(--foo element property index, 1, 10) is basically identical to the max-randomness random(1, 10) use, except it can separate out some usages in weird corner cases that would otherwise become identical.)
We resolved to accept these suggested keywords, but to open a new issue to discuss their exact spelling.
If anyone has alternate ideas they'd like to champion, feel free. (Otherwise, we'll just stick with the resolution.)