Port fontWeights module to plugin

This commit is contained in:
Adam Wathan 2019-01-09 21:17:49 -05:00
parent 964bf81ee3
commit 07193bb310
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('fontWeights'), (value, modifier) => {
return [`.${e(`font-${modifier}`)}`, {
'font-weight': value,
}]
}))
addUtilities(utilities, config('modules.fontWeights'))
}
}