forked from tailwindlabs/tailwindcss
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathborderWidth.js
More file actions
26 lines (23 loc) · 886 Bytes
/
borderWidth.js
File metadata and controls
26 lines (23 loc) · 886 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import _ from 'lodash'
import nameClass from '../util/nameClass'
export default function () {
return function ({ addUtilities, theme, variants }) {
const generators = [
(value, modifier) => ({
[nameClass('border', modifier)]: { borderWidth: `${value}` },
}),
(value, modifier) => ({
[nameClass('border-t', modifier)]: { borderTopWidth: `${value}` },
[nameClass('border-r', modifier)]: { borderRightWidth: `${value}` },
[nameClass('border-b', modifier)]: { borderBottomWidth: `${value}` },
[nameClass('border-l', modifier)]: { borderLeftWidth: `${value}` },
}),
]
const utilities = _.flatMap(generators, (generator) => {
return _.flatMap(theme('borderWidth'), (value, modifier) => {
return generator(value, modifier)
})
})
addUtilities(utilities, variants('borderWidth'))
}
}