This repository has been archived by the owner on Nov 29, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
windi.config.ts
61 lines (57 loc) · 1.91 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
import { defineConfig } from "vite-plugin-windicss";
import typography from "windicss/plugin/typography";
function cssVarRgbHelper(cssVariable: string) {
return ({ opacityVariable, opacityValue }: { opacityVariable: string; opacityValue: number }) => {
if (opacityValue !== undefined)
return `rgba(var(--${cssVariable}), ${opacityValue})`;
if (opacityVariable !== undefined)
return `rgba(var(--${cssVariable}), var(${opacityVariable}, 1))`;
return `rgb(var(--${cssVariable}))`;
};
}
export default defineConfig({
darkMode: "class",
plugins: [typography()],
safelist: ["invisible"],
theme: {
extend: {
colors: {
primary: {
100: cssVarRgbHelper("primary-100"),
200: cssVarRgbHelper("primary-200"),
300: cssVarRgbHelper("primary-300"),
400: cssVarRgbHelper("primary-400"),
500: cssVarRgbHelper("primary-500"),
600: cssVarRgbHelper("primary-600"),
700: cssVarRgbHelper("primary-700"),
800: cssVarRgbHelper("primary-800"),
900: cssVarRgbHelper("primary-900"),
},
secondary: {
100: cssVarRgbHelper("secondary-100"),
200: cssVarRgbHelper("secondary-200"),
300: cssVarRgbHelper("secondary-300"),
400: cssVarRgbHelper("secondary-400"),
500: cssVarRgbHelper("secondary-500"),
600: cssVarRgbHelper("secondary-600"),
700: cssVarRgbHelper("secondary-700"),
800: cssVarRgbHelper("secondary-800"),
900: cssVarRgbHelper("secondary-900"),
},
surface: {
100: cssVarRgbHelper("surface-100"),
200: cssVarRgbHelper("surface-200"),
300: cssVarRgbHelper("surface-300"),
400: cssVarRgbHelper("surface-400"),
500: cssVarRgbHelper("surface-500"),
600: cssVarRgbHelper("surface-600"),
700: cssVarRgbHelper("surface-700"),
800: cssVarRgbHelper("surface-800"),
900: cssVarRgbHelper("surface-900"),
1000: cssVarRgbHelper("surface-1000"),
},
error: cssVarRgbHelper("error"),
},
},
},
});