tailwindcss/src/generators/borderWidths.js
2017-11-06 15:29:40 -05:00

29 lines
680 B
JavaScript

import _ from 'lodash'
import defineClasses from '../util/defineClasses'
function sizedBorder(width, modifier) {
modifier = modifier === 'default' ? '' : `-${modifier}`
return defineClasses({
[`border${modifier}`]: {
'border-width': `${width}`,
},
[`border-t${modifier}`]: {
'border-top-width': `${width}`,
},
[`border-r${modifier}`]: {
'border-right-width': `${width}`,
},
[`border-b${modifier}`]: {
'border-bottom-width': `${width}`,
},
[`border-l${modifier}`]: {
'border-left-width': `${width}`,
},
})
}
module.exports = function({ borderWidths }) {
return _.flatMap(borderWidths, sizedBorder)
}