Re: [csswg-drafts] [css-values-5] seeded random values (#12072)

👋🏻 Hi, I'm Joe from [Happo](https://happo.io), a visual regression testing service.

I want to echo what @kizu said about the importance of being able to seed `random()` for deterministic behavior. This is crucial for visual regression tools like Happo, where we aim for screenshot consistency _out of the box_, without needing users to manually patch or sanitize their styles.

We’ve run into similar challenges with CSS animations, which can thankfully be mitigated today by injecting global styles to disable them--without having to parse or rewrite the original stylesheets. Having a parallel approach for `random()` would be a huge win.

One idea: maybe there could be a mechanism similar to `color-scheme`, where both a CSS property and a meta tag can control the behavior? For example:

CSS: 

```css
* {
  random-seed: 123 !important;
}
```

Meta tag:

```html
<meta name="random-seed" content="123" />
```

Thanks for considering this. It would go a long way toward making randomness in CSS a tool rather than a source of flakiness for these kinds of tests.


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


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

Received on Friday, 22 August 2025 18:17:48 UTC