tailwindcss/src/plugins/width.js

19 lines
384 B
JavaScript
Raw Normal View History

import _ from 'lodash'
2019-02-28 12:39:17 -05:00
export default function() {
return function({ addUtilities, e, config }) {
2019-01-11 12:29:33 -05:00
const utilities = _.fromPairs(
2019-02-28 12:39:17 -05:00
_.map(config('theme.width'), (value, modifier) => {
2019-01-11 12:29:33 -05:00
return [
`.${e(`w-${modifier}`)}`,
{
width: value,
},
]
})
)
2019-02-28 12:39:17 -05:00
addUtilities(utilities, config('variants.width'))
}
}