found this deep dive into making the new
random()
function work everywhere via a polyfill. it is basically an old classic from css-tricks that explains how to simulate
true randomness in browsers that do not support the spec yet. the implementation logic is actually pretty clever if you wanna avoid heavy javascript loops for every element.
it relies on some creative math using existing css functions . does anyone else think we should stop relying on js for simple animations and just wait for native support?
im sure it will be standard soon but until then, this is a solid workaround.
https://css-tricks.com/css-random-function-polyfill/