-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathunocss.config.ts
40 lines (38 loc) · 971 Bytes
/
unocss.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
// unocss.config.ts
import { defineConfig, presetAttributify, presetUno } from 'unocss';
export default defineConfig({
presets: [presetUno(), presetAttributify()],
shortcuts: [
{ flexc: 'flex items-center justify-center' },
{ flexb: 'flex items-center justify-between' },
{ btn: 'rounded-5px text-center cursor-pointer select-none' },
{ 'text-btn': 'text-center cursor-pointer select-none' },
],
rules: [
[
/^truncate-(\d+)$/,
([, d]) => ({
overflow: 'hidden',
display: '-webkit-box',
'text-overflow': 'ellipsis',
'-webkit-line-clamp': d,
'-webkit-box-orient': 'vertical',
}),
],
[
/^center-text-(\d+)$/,
([, d]) => ({
height: `${d}px`,
'align-items': 'center',
'line-height': `${Number(d) - 2}px`,
}),
],
[
/^wh-(\d+)$/,
([, d]) => ({
width: `${d}px`,
height: `${d}px`,
}),
],
],
});