-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtailwind.config.js
70 lines (68 loc) · 1.58 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
65
66
67
68
69
70
/** @type {import('tailwindcss').Config} */
module.exports = {
content: ['./src/pages/**/*.tsx', './src/components/**/*.tsx'],
theme: {
extend: {},
},
plugins: [],
}
const antdToken = require('./tailwind-color_seed');
const { theme } = require('tailwindcss/defaultConfig');
const colors = require('tailwindcss/colors');
// console.log('theme tw', theme);
const pick = (
obj,
keys,
) => {
if (!obj) return {};
return keys.reduce((acc, key) => {
// eslint-disable-next-line no-prototype-builtins
if (obj.hasOwnProperty(key)) acc[key] = obj[key];
return acc;
}, {});
};
/** @type {import('tailwindcss').Config} */
module.exports = {
content: ['./src/pages/**/*.tsx', './src/components/**/*.tsx'],
plugins: [],
corePlugins: { preflight: false },
theme: {
// eg. lg:text-primary
screens: {
...(antdToken.screen || {}),
},
colors: {
// eg. text-primary
...(antdToken.colors || {}),
...pick(colors, ['white', 'black']),
},
fontSize: {
// eg. text-heading4
...(antdToken.fontSize || {}),
},
borderRadius: {
// eg. text-sm
...(antdToken.borderRadius || {}),
...pick(theme.borderRadius, ['full']),
},
boxShadow: {
...(antdToken.boxShadow || {}),
},
extend: {
fontWeight: {
...(antdToken.fontWeight || {}),
},
space: {
// eg. text-sm
...(antdToken.space || {}),
},
margin: {
...(antdToken.space || {}),
},
padding: {
// eg. text-sm
...(antdToken.space || {}),
},
}
},
};