forked from AnthonyJu/vitesse-plain-pro
-
Notifications
You must be signed in to change notification settings - Fork 0
/
uno.config.ts
71 lines (70 loc) · 1.82 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
65
66
67
68
69
70
71
import {
defineConfig,
presetAttributify,
presetIcons,
presetTypography,
presetUno,
transformerDirectives,
transformerVariantGroup,
} from 'unocss'
export default defineConfig({
rules: [
[
/^shadow-(\D+)$/,
([, d]) => {
const s = '2px var(--el-border-color)'
switch (d) {
case 'b':
return { 'box-shadow': `0px 1px ${s}` }
case 'r':
return { 'box-shadow': `1px 0px ${s}` }
case 't':
return { 'box-shadow': `0px -1px ${s}` }
case 'l':
return { 'box-shadow': `-1px 0px ${s}` }
}
},
],
[
/^grid-(\D+)-(\d+)(\D+)$/,
([,a, n, u]) => {
return {
'display': 'grid',
'grid-template-columns': `repeat(auto-${a}, minmax(min(${n + u}, 100%), 1fr))`,
}
},
],
],
shortcuts: {
'full': 'w-full h-full',
'flex-col': 'flex flex-col',
'flex-items': 'flex items-center',
'flex-bc': 'flex justify-between items-center',
'flex-center': 'flex justify-center items-center',
'flex-col-center': 'flex flex-col justify-center items-center',
'turn-dark': 'invert-88.8 hue-rotate-180',
'turn-light': 'brightness-98 contrast-98',
'bg-default': 'bg-$el-layout-bg-color dark:bg-$el-layout-bg-color-dark',
'layout-default': 'bg-default p-15px rounded-4px',
},
presets: [
// 启用 uno 预设
presetUno(),
// 启用 属性 预设
presetAttributify(),
// 启用 icons 预设
presetIcons({
scale: 1.2,
warn: true,
cdn: 'https://esm.sh/',
}),
// 启用 排版 预设
presetTypography(),
],
transformers: [
// 启用 @apply 功能
transformerDirectives(),
// 启用 () 分组功能,hover:(bg-blue-500 font-large) font-(dark 900)
transformerVariantGroup(),
],
})