DEV Community

Discussion on: Random numbers in CSS?

Collapse
 
moopet profile image
Ben Sinclair

Can you think of an example of when it would be useful?

Collapse
 
devy profile image
Dev Ieffe

It's e.g. when create a class for a design element that is likely to have varied sizes like a dashboard with sticky notes that aren't all the same size.
.random { width: rand(Npx,Mpx,t) } N=min, M=max, t=level (step) of randomization, etc.
Each time the page loads, the user has slightly another look.