-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathwindi.config.ts
43 lines (41 loc) · 1.39 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
import { defineConfig } from "vite-plugin-windicss";
import typography from "windicss/plugin/typography";
import colors from "windicss/colors";
/**
* Creates bullshit css variables that support transparency
* @author Bluskript
*/
function cssVarRgbHelper(cssVariable: string) {
return ({ opacityVariable, opacityValue }: { opacityVariable: string; opacityValue: number }) => {
if (opacityValue) return `rgba(var(--${cssVariable}), ${opacityValue})`;
if (opacityVariable) return `rgba(var(--${cssVariable}), var(${opacityVariable}, 1))`;
return `rgb(var(--${cssVariable}))`;
};
}
export default defineConfig({
darkMode: "class",
plugins: [typography()],
theme: {
extend: {
colors: {
...colors,
accent: cssVarRgbHelper("accent"),
aqua: cssVarRgbHelper("aqua"),
contrast: cssVarRgbHelper("contrast"),
category: cssVarRgbHelper("category-text"),
title: cssVarRgbHelper("title-text"),
theme: {
100: cssVarRgbHelper("theme-100"),
200: cssVarRgbHelper("theme-200"),
300: cssVarRgbHelper("theme-300"),
400: cssVarRgbHelper("theme-400"),
500: cssVarRgbHelper("theme-500"),
600: cssVarRgbHelper("theme-600"),
700: cssVarRgbHelper("theme-700"),
800: cssVarRgbHelper("theme-800"),
900: cssVarRgbHelper("theme-900"),
},
},
},
},
});