Replace cool new JS features with lodash because node 8/10

This commit is contained in:
Adam Wathan 2020-07-24 12:15:28 -04:00
parent 29b0739c35
commit d7732c70fc

View File

@ -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}`)}`,
{