Skip to content

Instantly share code, notes, and snippets.

@HendrikRoth
Forked from futurist/cssobj-plugin-keyframes.js
Created November 11, 2016 11:38
Show Gist options
  • Save HendrikRoth/46834e6b9c2cd7fb482d543ac99200dd to your computer and use it in GitHub Desktop.
Save HendrikRoth/46834e6b9c2cd7fb482d543ac99200dd to your computer and use it in GitHub Desktop.
cssobj-plugin-keyframes.js
const random = +new Date()
export default {
selector: function(sel) {
let match = /^\s*@keyframes (.*)$/i.exec(sel)
return match ? '@keyframes ' + match[1].trim() + random : sel
},
value: function(val, key) {
return key=='animateName' ? val + random : val
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment