Embracing playful imperfection with the CSS random() function

Smashing Magazine logo, title “Embracing Playful Imperfection With The CSS random() Function”, “written by Brecht De Ruyte”, the author’s photo, and a red cat chasing a bird.

Brecht De Ruyte shows how random() takes a minimum, a maximum, and an optional step in matching units, so letters tilt, cards wobble, and marquee rows move at different speeds without JavaScript. Shared keys keep related properties in sync, and element-scoped makes values unique per element. It’s already in Safari, Chrome, and Firefox behind a flag, so wrap it in @supports and use it for decorative effects.

smashingmagazine.com/2026/10/embracing-playful-imperfection-css-random-function