Rename borderWidths to borderWidth

This commit is contained in:
Adam Wathan 2019-02-14 15:24:15 -05:00
parent df8fe5afa6
commit 856fdbc3dd
6 changed files with 5 additions and 5 deletions

View file

@ -0,0 +1,25 @@
import _ from 'lodash'
export default function({ values, variants }) {
return function({ addUtilities, e }) {
const generators = [
(value, modifier) => ({
[`.${e(`border${modifier}`)}`]: { borderWidth: `${value}` },
}),
(value, modifier) => ({
[`.${e(`border-t${modifier}`)}`]: { borderTopWidth: `${value}` },
[`.${e(`border-r${modifier}`)}`]: { borderRightWidth: `${value}` },
[`.${e(`border-b${modifier}`)}`]: { borderBottomWidth: `${value}` },
[`.${e(`border-l${modifier}`)}`]: { borderLeftWidth: `${value}` },
}),
]
const utilities = _.flatMap(generators, generator => {
return _.flatMap(values, (value, modifier) => {
return generator(value, modifier === 'default' ? '' : `-${modifier}`)
})
})
addUtilities(utilities, variants)
}
}