mirror of
https://github.com/tailwindlabs/tailwindcss.git
synced 2025-12-08 21:36:08 +00:00
27 lines
721 B
JavaScript
27 lines
721 B
JavaScript
import _ from 'lodash'
|
|
|
|
export default function() {
|
|
return function({ addUtilities, e, theme, variants }) {
|
|
const keyframesConfig = theme('keyframes')
|
|
const keyframesStyles = _.fromPairs(
|
|
_.toPairs(keyframesConfig).map(([name, keyframes]) => {
|
|
return [`@keyframes ${name}`, keyframes]
|
|
})
|
|
)
|
|
addUtilities(keyframesStyles, { respectImportant: false })
|
|
|
|
const animationConfig = theme('animation')
|
|
const utilities = _.fromPairs(
|
|
_.toPairs(animationConfig).map(([suffix, animation]) => {
|
|
return [
|
|
`.${e(`animate-${suffix}`)}`,
|
|
{
|
|
animation,
|
|
},
|
|
]
|
|
})
|
|
)
|
|
addUtilities(utilities, variants('animation'))
|
|
}
|
|
}
|