Port backgroundColors module to plugin

This commit is contained in:
Adam Wathan 2019-01-09 21:50:03 -05:00
parent 0cd679b4ff
commit c39ed44c13
4 changed files with 15 additions and 12 deletions

View file

@ -0,0 +1,13 @@
import _ from 'lodash'
export default function () {
return function ({ addUtilities, config, e }) {
const utilities = _.fromPairs(_.map(config('backgroundColors'), (value, modifier) => {
return [`.${e(`bg-${modifier}`)}`, {
'background-color': value,
}]
}))
addUtilities(utilities, config('modules.backgroundColors'))
}
}