forked from tailwindlabs/tailwindcss
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrounded.js
More file actions
35 lines (33 loc) · 878 Bytes
/
rounded.js
File metadata and controls
35 lines (33 loc) · 878 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
27
28
29
30
31
32
33
34
35
import _ from 'lodash'
import defineClass from '../util/defineClass'
import defineClasses from '../util/defineClasses'
function sideVariants() {
return defineClasses({
'rounded-t': {
'border-bottom-right-radius': '0',
'border-bottom-left-radius': '0',
},
'rounded-r': {
'border-bottom-left-radius': '0',
'border-top-left-radius': '0',
},
'rounded-b': {
'border-top-left-radius': '0',
'border-top-right-radius': '0',
},
'rounded-l': {
'border-top-right-radius': '0',
'border-bottom-right-radius': '0',
},
})
}
module.exports = function({ borderRadius }) {
return _(borderRadius)
.map((radius, modifier) => {
return defineClass(modifier === 'default' ? 'rounded' : `rounded-${modifier}`, {
'border-radius': radius,
})
})
.concat(sideVariants())
.value()
}