Skip to content

Commit

Permalink
Replace cool new JS features with lodash because node 8/10
Browse files Browse the repository at this point in the history
  • Loading branch information
adamwathan committed Jul 24, 2020
1 parent 29b0739 commit d7732c7
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/plugins/animation.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
import _ from 'lodash'

export default function() {
return function({ addBase, addUtilities, e, theme, variants }) {
const keyframesConfig = theme('keyframes')
const keyframesStyles = Object.fromEntries(
Object.entries(keyframesConfig).map(([name, keyframes]) => {
const keyframesStyles = _.fromPairs(
_.toPairs(keyframesConfig).map(([name, keyframes]) => {
return [`@keyframes ${name}`, keyframes]
})
)
addBase(keyframesStyles)

const animationConfig = theme('animation')
const utilities = Object.fromEntries(
Object.entries(animationConfig).map(([suffix, animation]) => {
const utilities = _.fromPairs(
_.toPairs(animationConfig).map(([suffix, animation]) => {
return [
`.${e(`animate-${suffix}`)}`,
{
Expand Down

0 comments on commit d7732c7

Please sign in to comment.