-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuno.config.ts
43 lines (42 loc) · 1.26 KB
/
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
37
38
39
40
41
42
43
import {
defineConfig,
presetAttributify,
presetIcons,
presetUno,
transformerDirectives,
} from "unocss";
export default defineConfig({
rules: [
// md3 background color
[
/^bg-md-(.+)$/,
([, w]) => ({ "background-color": `var(--md-sys-color-${w})` }),
],
// md3 text color
[/^text-md-(.+)$/, ([, w]) => ({ color: `var(--md-sys-color-${w})` })],
// md3 label size
[
/^label-md-(\w+)$/,
([, w]) => ({
"font-size": `var(--md-sys-typescale-label-${w}-size)`,
"font-weight": `var(--md-sys-typescale-label-${w}-weight)`,
"letter-space": `var(--md-sys-typescale-label-${w}-font-tracking)`,
}),
],
// md3 elevation
[
/^elevation-(\d+)$/,
([, d]) => ({ "box-shadow": `var(--md-sys-elevation-level${d})` }),
],
// md3 states
[
/^state-(\w+)$/,
([, d], {}) =>
`.state-${d}:${d} {
opacity: var(--md-sys-state-${d}-state-layer-opacity);
}`,
]
],
presets: [presetIcons(), presetUno(), presetAttributify()],
transformers: [transformerDirectives()],
});