-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathwindi.config.ts
101 lines (92 loc) · 2.41 KB
/
windi.config.ts
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
import { defineConfig } from 'windicss/helpers';
function generateColorsBySemi() {
const disc = {
// static colors
white: 'rgba(var(--semi-white), 1)',
black: 'rgba(var(--semi-black), 1)',
};
(function buildTypes(types: string[], noDisable: string[]) {
types.forEach((t) => {
// to text-#{t}-hover, bg-#{t}-active, border-#{t}-light, ...
disc[t] = {
DEFAULT: `var(--semi-color-${t})`,
hover: `var(--semi-color-${t}-hover)`,
active: `var(--semi-color-${t}-active)`,
...(!noDisable.includes(t) && {
disabled: `var(--semi-color-${t}-disabled)`,
}),
light: `var(--semi-color-${t}-light-default)`,
'light-hover': `var(--semi-color-${t}-light-hover)`,
'light-active': `var(--semi-color-${t}-light-active)`,
};
});
})(['primary', 'secondary', 'tertiary', 'info', 'success', 'warning', 'danger'], ['tertiary', 'warning', 'danger']);
(function buildColors(colors: string[]) {
const levels = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
colors.forEach((c) => {
// to text-#{t}-1, bg-#{t}-2, border-#{t}-3, ...
disc[c] = Object.assign(
{
DEFAULT: `rgba(var(--semi-${c}-5), 1)`,
},
...levels.map((l) => ({ [l]: `rgba(var(--semi-${c}-${l}), 1)` })),
);
});
})([
'red',
'pink',
'purple',
'violet',
'indigo',
'blue',
'light-blue',
'cyan',
'teal',
'green',
'light-green',
'lime',
'yellow',
'amber',
'orange',
'grey',
]);
return disc;
}
export default defineConfig({
extract: {
include: ['**/*.{jsx,tsx,css}'],
exclude: ['node_modules', '.git', '.next'],
},
darkMode: 'class',
theme: {
// "spacing" by padding,margin,width,height
// padding: {
// xs: '4px',
// sm: '8px',
// md: '16px',
// lg: '32px',
// xl: '64px',
// },
// margin: {
// xs: '4px',
// sm: '8px',
// md: '16px',
// lg: '32px',
// xl: '64px',
// },
colors: generateColorsBySemi(),
screens: {
sm: '640px',
// => @media (min-width: 640px) { ... }
md: '768px',
// => @media (min-width: 768px) { ... }
lg: '1024px',
// => @media (min-width: 1024px) { ... }
xl: '1280px',
// => @media (min-width: 1280px) { ... }
'2xl': '1536px',
// => @media (min-width: 1536px) { ... }
},
},
shortcuts: {},
});