Are there any plans to implement support for the CSS random() function? I’m a web developer and it would make a browser game I’m making so much simpler.
Follow this bug:
Two pieces of bad news: 1) It doesn’t appear to be supported by Chrome which means there’s less pressure for Mozilla to support it., 2) The bug is currently unassigned.
Exactly, it is not supported by chrome
It would be great to see support for CSS random()! It could simplify a lot of game-related styling, especially when generating randomized positions, sizes, rotations, or animation delays without relying on JavaScript for every variation.
However, browser support depends on the CSS specification and each browser engine’s implementation plans. Has there been any official discussion or an issue opened with the relevant browser team about implementation status?
In the meantime, JavaScript or CSS custom properties can be used to generate random values and pass them into styles, although native CSS support would make this much cleaner.
I’d also be interested to hear whether anyone knows of an active implementation proposal or a browser roadmap for this feature.