mirror of
https://github.com/tailwindlabs/tailwindcss.git
synced 2025-12-08 21:36:08 +00:00
29 lines
680 B
JavaScript
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)
|
|
}
|