v156 · css · covered on mdn
CSS random() function
A CSS Values Level 5 math function that resolves to a random numeric value drawn uniformly between a minimum and a maximum, optionally stepped. By default each random() instance resolves to its own distinct value; an optional leading <random-key> argument controls whether and how a resolved value is shared across properties and elements. Shipped enabled-by-default in Chrome 156; already shipping in Safari 26.2.
this feature is documented on MDN
MDN’s reference covers the function in full — value syntax, the <random-key> sharing semantics, formal grammar, examples, specifications, and browser compatibility (verified substantive — Specifications and Browser compatibility sections present — 2026-11-01). gendn doesn’t duplicate that here.
Why gendn doesn't duplicate MDN: this site exists for Chrome features that have no MDN reference yet. When MDN covers a feature completely, the honest page is a pointer to the canonical reference plus the shipping metadata MDN doesn't track — duplicated prose would only drift out of sync.
quick reference
| The change | New math function <random()> = random( <random-key>? , <calc-sum>, <calc-sum>, <calc-sum>? ) — grammar quoted verbatim from the css-values-5 Editor’s Draft (fetched 2026-11-01): uniform-distribution value between min and max, optional step, optional sharing key. The spec notes the generation method is UA-defined and “authors must not rely on random functions for any purposes that depend on quality cryptography” |
|---|---|
| Chrome status | Listed under “Enabled by default” in the milestone=156 listing (fetched 2026-11-01; the listing is authoritative for filing). Runtime feature CSSRandomFunction reads status: "stable" in runtime_enabled_features.json5 at trunk (verified 2026-11-01); the Typed OM companion CSSRandomFunctionTypedOM is still status: "test" |
| Spec | CSS Values and Units Module Level 5 — random() (the ChromeStatus record’s spec link; Editor’s Draft §9.1) |
| MDN | random() |
| Browser compatibility | BCD css/types/random.json (fetched 2026-11-01): Chrome 156, Edge mirrors Chrome, Safari 26.2, Firefox preview only |
| Baseline | Limited availability per webstatus.dev random-function (queried 2026-11-01): Chrome/Chrome Android 156 (2026-10-20), Safari/iOS 26.2 (2025-12-12); Firefox not yet available (BCD: preview). Not Baseline until Firefox ships |
| ChromeStatus | 5324559251275776 — CSS random() function (blink component Blink>CSS) |
| Explainers | WebKit blog — Rolling the dice with CSS random(); CSS-Tricks almanac — random() (both linked from the ChromeStatus record) |
| Interactive demo | No chrome-platform-showcase demo is built for this feature yet (route HEAD-checked 404, 2026-11-01); MDN’s page carries live examples |