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

Sorry if this was discussed already, but I was wondering about a case where one toggles some class with randomness on an element
```
.random {
 width: random(100px, 200px);
}
...
setInterval(() => target.classList.toggle("random"), 1000);
```

It sounded like this would only pick one random value and then persist that for all other uses of the `.random` class on that particular element, which doesn't sound too random. 

I wonder if there is an opportunity to include some sort of a generation id in the cache key that updates if the style applicability is interrupted as in the case above. There is somewhat tangential precedent to this in contain-intrinsic-size's last remembered size and how that sticks around while the property is continually applied and is forgotten otherwise 

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


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

Received on Wednesday, 19 March 2025 19:30:08 UTC