Elementary Standards
HTMLCSSWeb StandardsSEOBlogStart reading
Home / Blog / Firefox 161 Ships CSS random()
News

Firefox 161 Ships CSS random()

All three engines now generate random values in a stylesheet — but they don't agree on how far that randomness is allowed to reach.

Firefox 161 reached the release channel on November 24, 2026, and its release notes confirm what this site flagged as a gap back when Chrome 156 shipped the same function: the CSS random() value is now supported in Firefox too, generating a random length, percentage, angle or integer directly from a stylesheet rule, with an optional step size and a shared <random-key> parameter. With Safari having shipped it first in Safari 26.2 and Chrome landing it in version 157, Firefox 161 is the last of the three major engines to add the feature, as reported independently by Phoronix's coverage of the release. For teams that maintain production CSS across all three browsers, that is the headline. The fine print is where the three implementations still disagree, and it matters more for anyone shipping it this quarter — exactly the kind of cross-browser edge case that argues for bringing in engineers who hire front end web developers through rather than discover mid-sprint.

Safari 26.2Chrome 157Firefox 161random()registered props: diverge

What shipped and what still differs

The core syntax is settled across engines: random(0%, 100%) or rotate: random(-5deg, 5deg, 1deg) resolve to a value picked by the rendering engine, with no script involved and no hydration mismatch to reconcile against server-rendered markup. Every matched element gets its own independent draw by default, which is what makes scatter and confetti effects work from a single declaration. Where the engines part ways is in the corners of the spec that were still being finalized while the first implementation shipped. Safari's WebKit team has documented that it rejects random() inside a CSS @property registered custom property and does not support property-scoped or property-index-scoped keys, both of which Chromium accepts. Can I Use's compatibility table for the feature tracks this split directly, flagging it as a case where "support" and "identical behavior" are not the same claim.

What this means for developers

If a project's random-value usage stays inside the common subset — a plain random() call with a literal min/max/step, optionally sharing a named key between a couple of declarations — all three engines now render it the same way, and it is safe to drop the JavaScript fallback that generated scatter, shuffle or wheel-of-fortune positions before. The risk sits specifically with registered custom properties: a design system that defines a typed @property and expects to drive its value with random() inside that property's definition will render correctly in Chrome and silently fail or fall back in Safari. That is a QA gap a visual regression test on Chrome alone will not catch, because the bug only shows up in the engine nobody tested against. Teams relying on motion from random() should also keep gating it behind prefers-reduced-motion, the same discipline already expected of scroll-driven and keyframe animation. In practice, that means adding a Safari pass to any cross-browser visual QA checklist specifically for random() usage, rather than assuming a green Chrome run covers the feature everywhere it is used.

When does this ship everywhere

With Firefox 161 now on the release channel, random() has landed in a stable build of every major engine, which typically means Baseline status follows once MDN's browser-compat data is updated to reflect the release — a formality rather than a question mark at this point. The property-registration gap is a separate, slower-moving interop issue tracked in the CSS Working Group's issue list rather than a release-blocking one, so expect it to persist for a few more browser cycles. Until Can I Use or MDN explicitly marks that specific combination as aligned, treat random() inside a registered custom property as Chrome-only, and keep the plain declaration form as the default for anything that has to render identically in Safari, Chrome and Firefox.

Back to the blog
More notes

Keep reading