-
Notifications
You must be signed in to change notification settings - Fork 7
/
uno.config.ts
36 lines (34 loc) · 876 Bytes
/
uno.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
import { defineConfig, presetTypography, presetIcons } from "unocss";
import presetWind from "@unocss/preset-wind";
export default defineConfig({
presets: [presetWind(), presetTypography(), presetIcons()],
theme: {
colors: {
blank: "var(--blank-color)",
base: "var(--base-color)",
primary: "var(--main-color)",
secondary: "var(--second-color)",
desc: "var(--thrid-color)",
},
},
rules: [
[
/^text-(.*)$/,
([, c], { theme }) => {
if (theme.colors?.[c]) return { color: theme.colors[c] };
},
],
[
/^bg-(.*)$/,
([, c], { theme }) => {
if (theme.colors?.[c]) return { background: theme.colors[c] };
},
],
[
/^border-(.*)$/,
([, c], { theme }) => {
if (theme.colors?.[c]) return { "border-color": theme.colors[c] };
},
],
],
});