Port width and whitespace modules to plugins

This commit is contained in:
Adam Wathan 2019-01-09 13:01:57 -05:00
parent 6352843cde
commit 027b69c7e8
7 changed files with 39 additions and 140 deletions

13
src/plugins/width.js Normal file
View file

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