-
Notifications
You must be signed in to change notification settings - Fork 79
/
Copy pathuno.config.ts
50 lines (48 loc) · 1.45 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
import {
defineConfig,
presetIcons,
transformerDirectives,
transformerVariantGroup,
} from 'unocss';
import presetWeapp from 'unocss-preset-weapp';
import { extractorAttributify, transformerClass } from 'unocss-preset-weapp/transformer';
const { presetWeappAttributify, transformerAttributify } = extractorAttributify();
export default defineConfig({
presets: [
// https://github.com/MellowCo/unocss-preset-weapp
presetWeapp() as any,
// attributify autocomplete
presetWeappAttributify() as any,
// https://unocss.dev/presets/icons
presetIcons({
scale: 1.2,
warn: true,
extraProperties: {
'display': 'inline-block',
'vertical-align': 'middle',
},
}),
],
/**
* 自定义快捷语句
* @see https://github.com/unocss/unocss#shortcuts
*/
shortcuts: {
'border-base': 'border border-gray-500_10',
'center': 'flex justify-center items-center',
},
transformers: [
// 启用 @apply 功能
transformerDirectives({
enforce: 'pre',
}),
// https://unocss.dev/transformers/variant-group
// 启用 () 分组功能
transformerVariantGroup(),
// https://github.com/MellowCo/unocss-preset-weapp/tree/main/src/transformer/transformerAttributify
transformerAttributify() as any,
// https://github.com/MellowCo/unocss-preset-weapp/tree/main/src/transformer/transformerClass
transformerClass(),
// https://unocss.dev/transformers/directives
],
});