tailwindcss/src/plugins/maxWidth.js

19 lines
395 B
JavaScript
Raw Normal View History

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