-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathtwindBaseConfig.js
104 lines (102 loc) · 3.44 KB
/
twindBaseConfig.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
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
function withOpacity(variable) {
return ({ opacityValue }) => {
if (opacityValue === undefined) {
return `rgb(var(${variable}))`;
}
return `rgb(var(${variable}) / ${opacityValue})`;
};
}
function withHslOpacity(variable) {
return ({ opacityValue }) => {
if (opacityValue === undefined) {
return `hsl(var(${variable}))`;
}
return `hsl(var(${variable}) / ${opacityValue})`;
};
}
export default {
darkMode: 'class',
hash: false,
theme: {
extend: {
fontFamily: {
sans: 'Inter, sans-serif',
},
colors: {
primaryStart: withOpacity('--gradient-primary-start'),
primaryStop: withOpacity('--gradient-primary-stop'),
secondaryLight: withOpacity('--foundation-secondary'),
secondaryDark: withOpacity('--foundation-secondary-dark'),
tertiaryLight: withOpacity('--tertiary-light'),
tertiaryDark: withOpacity('--tertiary-dark'),
black: withOpacity('--system-black'),
white: withOpacity('--system-white'),
grey1: withOpacity('--system-grey-1'),
grey2: withOpacity('--system-grey-2'),
grey3: withOpacity('--system-grey-3'),
grey4: withOpacity('--system-grey-4'),
grey5: withOpacity('--system-grey-5'),
grey6: withOpacity('--system-grey-6'),
grey7: withOpacity('--system-grey-7'),
grey8: withOpacity('--system-grey-8'),
grey9: withOpacity('--system-grey-9'),
success: withOpacity('--feedback-success'),
warningLight: withOpacity('--feedback-warning'),
warningDark: withOpacity('--feedback-warning-dark'),
errorLight: withOpacity('--feedback-error'),
errorDark: withOpacity('--feedback-error-dark'),
errorDark2: withOpacity('--feedback-error-dark2'),
errorFade: withOpacity('--feedback-error-fade'),
elevation: withOpacity('--elevation'),
border: withHslOpacity('--border'),
input: withHslOpacity('--input'),
ring: withHslOpacity('--ring'),
background: withHslOpacity('--background'),
foreground: withHslOpacity('--foreground'),
primary: {
DEFAULT: withHslOpacity('--primary'),
foreground: withHslOpacity('--primary-foreground'),
},
'primary-start': {
DEFAULT: withHslOpacity('--primary-start'),
},
'primary-end': {
DEFAULT: withHslOpacity('--primary-end'),
},
secondary: {
DEFAULT: withHslOpacity('--secondary'),
foreground: withHslOpacity('--secondary-foreground'),
},
destructive: {
DEFAULT: withHslOpacity('--destructive'),
foreground: withHslOpacity('--destructive-foreground'),
},
muted: {
DEFAULT: withHslOpacity('--muted'),
foreground: withHslOpacity('--muted-foreground'),
},
accent: {
DEFAULT: withHslOpacity('--accent'),
foreground: withHslOpacity('--accent-foreground'),
},
popover: {
DEFAULT: withHslOpacity('--popover'),
foreground: withHslOpacity('--popover-foreground'),
},
card: {
DEFAULT: withHslOpacity('--card'),
foreground: withHslOpacity('--card-foreground'),
},
},
borderRadius: {
large: '20px',
lg: `var(--radius)`,
md: `calc(var(--radius) - 2px)`,
sm: 'calc(var(--radius) - 4px)',
},
scale: {
flip: '-1',
},
},
},
};