-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuno.config.ts
More file actions
73 lines (71 loc) · 2.01 KB
/
uno.config.ts
File metadata and controls
73 lines (71 loc) · 2.01 KB
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
72
73
import { defineConfig, presetUno, presetIcons, UserConfig, transformerDirectives } from 'unocss';
// eslint-disable-next-line import/no-relative-packages
import { peiliuiPreset } from './packages/styles/src/unoPreset';
export default <UserConfig>defineConfig({
presets: [
presetUno(),
presetIcons({
collections: {
// Iconify json 集成,后续支持通过 <i class="i-pl-xxx"> 来使用图标原子类,并支持按需打包
// eslint-disable-next-line import/no-relative-packages
pl: () => import('./packages/icons/dist/icons.json').then(i => i.default),
},
}),
peiliuiPreset(),
],
transformers: [transformerDirectives()],
});
// export default defineConfig({
// // 添加全局样式,定义主题变量
// preflights: [
// {
// getCSS: () => `
// :root {
// --color-primary: #c7000b;
// --color-success: #50d4ab;
// --color-warning: #fbb175;
// --color-danger: #f66f6a;
// --color-info: #526ecc;
// }
// `,
// },
// ],
// // 添加主题变量
// theme: {
// colors: {
// primary: 'var(--color-primary)',
// success: 'var(--color-success)',
// warning: 'var(--color-warning)',
// danger: 'var(--color-danger)',
// info: 'var(--color-info)',
// },
// },
// // 添加规则
// rules: [
// [
// 'button-base',
// {
// cursor: 'pointer',
// display: 'inline-flex',
// padding: '6px 12px',
// },
// ],
// ],
// // 添加快捷方式
// shortcuts: [
// [
// 'button',
// `
// 'button-base text-14px c-primary bg-success'
// hover:bg-warning
// before:text-14px
// [&.button-danger]:bg-danger
// [&.button-info]:bg-info
// `,
// ],
// ['button-danger', 'c-danger'],
// ['button-info', 'c-info'],
// ],
// // 添加白名单(使特定的 CSS 类任何时候都生成)
// safelist: ['button', 'button-danger', 'button-info'],
// });