mirror of
https://github.com/tailwindlabs/tailwindcss.git
synced 2025-12-08 21:36:08 +00:00
39 lines
1001 B
JavaScript
39 lines
1001 B
JavaScript
import _ from 'lodash'
|
|
import defineClasses from '../util/defineClasses'
|
|
|
|
function defineBorderWidthUtilities(borderWidths) {
|
|
const generators = [
|
|
(width, modifier) =>
|
|
defineClasses({
|
|
[`border${modifier}`]: {
|
|
'border-width': `${width}`,
|
|
},
|
|
}),
|
|
(width, modifier) =>
|
|
defineClasses({
|
|
[`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}`,
|
|
},
|
|
}),
|
|
]
|
|
|
|
return _.flatMap(generators, generator => {
|
|
return _.flatMap(borderWidths, (width, modifier) => {
|
|
return generator(width, modifier === 'default' ? '' : `-${modifier}`)
|
|
})
|
|
})
|
|
}
|
|
|
|
module.exports = function({ borderWidths }) {
|
|
return defineBorderWidthUtilities(borderWidths)
|
|
}
|