-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathtailwind.config.ts
147 lines (141 loc) · 3.07 KB
/
tailwind.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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
import { defineConfig } from 'windicss/helpers'
import colors from 'windicss/colors';
import tinycolor2 from 'tinycolor2';
import { themeColors, rabbyCssPrefix } from './src/isomorphic/theme-colors';
const rabbyColors = [/* 'light', */'dark'].reduce((accu, theme) => {
Object.entries(themeColors[theme]).forEach(([cssvarKey, colorValue]) => {
const tinyColor = tinycolor2(colorValue as any);
const alpha = tinyColor.getAlpha();
const hexValue = alpha === 1 ? tinyColor.toHexString() : tinyColor.toHex8String();
if (!accu.auto[cssvarKey]) {
accu.auto[cssvarKey] = `var(--${rabbyCssPrefix}${cssvarKey}, ${hexValue})`;
}
accu[theme][cssvarKey] = hexValue;
});
return accu;
}, {
light: {},
dark: {},
auto: {},
});
export default defineConfig({
extract: {
// A common use case is scanning files from the root directory
include: ['**/*.{html,jsx,tsx}'],
// if you are excluding files, make sure you always include node_modules and .git
exclude: ['node_modules', '.git', 'dist'],
},
mode: 'jit',
theme: {
spacing: [
0,
1,
2,
4,
6,
8,
10,
12,
14,
16,
18,
20,
24,
28,
32,
40,
60,
80,
].reduce((m, n) => {
m[n] = `${n}px`;
return m;
}, {}),
screens: {
sm: { max: '600px' },
lg: { min: '600px' },
},
colors: {
transparent: 'transparent',
current: 'currentColor',
blue: {
from: '#8A78FD',
to: '#796BFD',
light: '#8697FF',
DEFAULT: '#796BFD',
},
black: '#707280',
green: '#27C193',
white: colors.white,
yellow: '#F29C1B',
orange: '#FFB020',
pink: '#F24822',
red: {
light: '#F24822',
DEFAULT: '#AF160E',
forbidden: '#EC5151',
},
gray: {
bg2: '#F5F6FA',
bg: '#F5F6FA',
divider: '#E5E9EF',
comment: '#B4BDCC',
content: '#707280',
subTitle: '#4B4D59',
title: '#13141A',
light: '#707880',
},
},
fontSize: {
12: [
'12px',
{
lineHeight: '14px',
},
],
13: '13px',
14: [
'14px',
{
lineHeight: '18px',
},
],
15: [
'15px',
{
lineHeight: '18px',
},
],
18: [
'18px',
{
lineHeight: '22px',
},
],
20: '20px',
24: [
'24px',
{
lineHeight: '28px',
},
],
28: [
'28px',
{
lineHeight: '33px',
},
],
},
extend: {
colors: {
// [`${rabbyCssPrefix.replace(/\-$/, '')}`]: rabbyColors,
[`${'rabby-'.replace(/\-$/, '')}`]: rabbyColors.auto,
'r': rabbyColors.auto,
// [`light-${rabbyCssPrefix.replace(/\-$/, '')}`]: rabbyColors.light,
[`dark-${rabbyCssPrefix.replace(/\-$/, '')}`]: rabbyColors.dark,
}
}
},
// use media-query prefers-color-scheme
darkMode: 'media',
important: true,
})