Many times CSS can works very well. When we need to modify the style sheet at runtime, I tend to operate or style instead of css in js. Because such a shema is not zero runtime.
But when I need to use variable in @keyframes, use js to generator would be very nice.
This idea is base on emotion, but sample implementation, if you want to use it in production; It's better to use emotion directly.
git clone git@github.com:pjshy/keyframes.git
cd keyframes
yarn
or
npm install
yarn dev
or
npm run dev