forked from tailwindlabs/tailwindcss
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathanimation.js
More file actions
26 lines (24 loc) · 721 Bytes
/
animation.js
File metadata and controls
26 lines (24 loc) · 721 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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'))
}
}