-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuno.config.ts
59 lines (58 loc) · 1.44 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
import { defineConfig, presetAttributify, presetIcons, presetUno, presetWebFonts, transformerDirectives } from 'unocss'
export default defineConfig({
presets: [
presetUno(),
presetAttributify(),
presetIcons({
warn: true,
extraProperties: {
'display': 'inline-block',
'vertical-align': 'middle',
},
scale: 1.2,
}),
presetWebFonts({
// fonts: {
// sans: 'DM Sans',
// serif: 'DM Serif Display',
// mono: 'DM Mono',
// },
}),
],
transformers: [transformerDirectives()],
content: {
pipeline: {
// 解决动态图标无法显示的问题 https://unocss-study-examples.netlify.app/#/CSSIcon
include: [
/\.(vue|svelte|[jt]sx|mdx?|astro|elm|php|phtml|html)($|\?)/,
'src/router/**/*.ts',
],
},
},
shortcuts: {
'flex-c': 'flex justify-center items-center',
'flex-bc': 'flex justify-between items-center',
},
rules: [
[
// 多行文本超出部分省略号 line-n
/^line-(\d+)$/,
([, l]) => {
if (~~l === 1) {
return {
'overflow': 'hidden',
'text-overflow': 'ellipsis',
'white-space': 'nowrap',
'width': '100%',
}
}
return {
'overflow': 'hidden',
'display': '-webkit-box',
'-webkit-box-orient': 'vertical',
'-webkit-line-clamp': l,
}
},
],
],
})