-
Notifications
You must be signed in to change notification settings - Fork 36
/
uno.config.ts
32 lines (31 loc) · 1.13 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
// uno.config.ts
import {defineConfig} from 'unocss'
import presetUno from "@unocss/preset-uno"
import presetIcons from "@unocss/preset-icons"
export default defineConfig({
presets: [
presetUno(), // 样式预设方案
presetIcons({
// 图标处理器
extraProperties: {// 图标样式
display: "inline-block",
"vertical-align": "middle"
}
})
],
rules: [
[/^m-([\.\d]+)$/, ([_, num]) => ({margin: `${num}px`})],
[/^p-([\.\d]+)$/, ([_, num]) => ({padding: `${num}px`})],
[/^h-([\.\d]+)$/, ([_, num]) => ({height: `${num}px`})],
[/^w-([\.\d]+)$/, ([_, num]) => ({width: `${num}px`})],
[/^left-([\.\d]+)$/, ([_, num]) => ({left: `${num}px`})],
[/^top-([\.\d]+)$/, ([_, num]) => ({top: `${num}px`})],
[/^right-([\.\d]+)$/, ([_, num]) => ({right: `${num}px`})],
[/^bottom-([\.\d]+)$/, ([_, num]) => ({bottom: `${num}px`})],
[/text-overflow/, () => ({
"text-overflow": "ellipsis",
overflow: "hidden",
"white-space": "nowrap"
})],
]
})