UNPKG

animista-css-generator

Version:
30 lines (26 loc) 532 B
const { cssHash } = require('css-hash'); const generator = require('../generator'); const animationClass = cssHash( (className) => ` ${generator.keyframes( className, ` 0%, 50%, 100% { opacity: 1; } 25%, 75% { opacity: 0; } `, )} .${className} { ${generator.fields( `animation: ${className} var(--animate-duration) both`, )} } `, ); module.exports = animationClass;