-
Notifications
You must be signed in to change notification settings - Fork 1
/
uno.config.ts
64 lines (56 loc) · 1.73 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
import { defineConfig, presetUno } from 'unocss'
function withLevels(name: string, levels: any[]) {
return levels.map((suffix) => `${name}-${suffix}`)
}
function vpColors(names: string[]) {
const colors: Record<string, string> = {}
for (const name of names) {
colors[name] = `var(--vp-c-${name})`
}
return colors
}
export default defineConfig({
presets: [presetUno()],
theme: {
colors: {
...vpColors([
// Colors: Solid
'white',
'black',
'neutral',
'neutral-inverse',
// Colors: Palette
...withLevels('gray', [1, 2, 3, 'soft']),
...withLevels('indigo', [1, 2, 3, 'soft']),
...withLevels('purple', [1, 2, 3, 'soft']),
...withLevels('green', [1, 2, 3, 'soft']),
...withLevels('yellow', [1, 2, 3, 'soft']),
...withLevels('red', [1, 2, 3, 'soft']),
'sponsor',
// Colors: Background
'bg',
...withLevels('bg', ['alt', 'elv', 'soft']),
// Colors: Borders
'border',
'divider',
'gutter',
// Colors: Text
...withLevels('text', [1, 2, 3]),
// Colors: Function
...withLevels('default', [1, 2, 3, 'soft']),
...withLevels('brand', [1, 2, 3, 'soft']),
...withLevels('tip', [1, 2, 3, 'soft']),
...withLevels('note', [1, 2, 3, 'soft']),
...withLevels('success', [1, 2, 3, 'soft']),
...withLevels('important', [1, 2, 3, 'soft']),
...withLevels('warning', [1, 2, 3, 'soft']),
...withLevels('danger', [1, 2, 3, 'soft']),
...withLevels('caution', [1, 2, 3, 'soft']),
]),
},
fontFamily: {
base: 'var(--vp-font-family-base)',
mono: 'var(--vp-font-family-mono)',
},
},
})