-
Notifications
You must be signed in to change notification settings - Fork 0
/
tailwind.config.js
64 lines (61 loc) · 1.55 KB
/
tailwind.config.js
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
const R = require('ramda')
const defaultTheme = require('tailwindcss/defaultTheme')
function getAntdColors (colors = []) {
const { red, volcano, orange, gold, yellow, lime, green, cyan, blue, geekblue, purple, magenta, grey } = require('@ant-design/colors')
const AntdColorsList = { red, volcano, orange, gold, yellow, lime, green, cyan, blue, geekblue, purple, magenta, grey }
const list = {}
colors.forEach(color => {
if (AntdColorsList[color]) {
list[color] = R.zipObj(R.range(1, color === 'grey' ? 9 : 11), AntdColorsList[color])
}
})
return list
}
const enablePlugins = [
'backgroundColor',
'cursor',
'display',
'fontSize',
'fontWeight',
'height',
'lineHeight',
'margin',
'overflow',
'padding',
'textAlign',
'textColor',
'verticalAlign',
'width',
]
module.exports = {
corePlugins: enablePlugins,
theme: {
colors: {
...R.pickBy(val => typeof val === 'string', defaultTheme.colors),
...getAntdColors(['blue', 'grey']),
},
screens: R.omit(['xl'], defaultTheme.screens),
spacing: Object
.keys(defaultTheme.spacing)
.filter(item => !isNaN(item))
.reduce((acc, item) => {
acc[item] = item + (item > 0 ? 'px' : '')
return acc
}, {}),
extend: {
fontSize: theme => R.pickBy((_, key) => key >= 12, theme('spacing')),
},
},
variants: {
...enablePlugins.reduce((acc, item) => {
const used = [
'width',
]
if (!used.includes(item)) {
acc[item] = []
}
return acc
}, {}),
},
plugins: [],
}