Simplify backgroundColor generator

This commit is contained in:
Adam Wathan 2017-08-26 15:49:20 -04:00
parent 7ae71315f9
commit d2b2722b2e

View File

@ -3,11 +3,9 @@ import defineClass from '../util/defineClass'
import normalizeColorList from '../util/normalizeColorList'
export default function ({ colors, backgroundColors }) {
backgroundColors = normalizeColorList(backgroundColors, colors)
return _(backgroundColors).toPairs().map(([className, color]) => {
return _.map(normalizeColorList(backgroundColors, colors), (color, className) => {
return defineClass(`bg-${className}`, {
backgroundColor: color,
})
}).value()
})
}