TLDR Web Dev · ARTICLES & TUTORIALS
ROLLING THE DICE WITH CSS RANDOM()
Summary from the TLDR Web Dev newsletter
Until now, there hasn't been a way to create random numbers in CSS. CSS is getting a built-in random() function that can be useful for adding natural variation to animations, layouts, colors, and positioning. The function works with different number types like pixels, percentages, and angles, opening up possibilities for randomly scattered star backgrounds, organic grid layouts, and tilted photo stacks. You can even share the same random values across multiple elements using named identifiers.