-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuno.config.ts
82 lines (78 loc) · 2.39 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
import {
defineConfig,
presetAttributify,
presetIcons,
presetUno,
presetWebFonts,
} from 'unocss'
export default defineConfig({
shortcuts: [
[
'icon-btn',
'text-[0.9em] inline-block cursor-pointer select-none opacity-75 transition duration-200 ease-in-out hover:opacity-100 hover:text-teal-600',
],
['flex-center', 'display-flex justify-center items-center'],
['btn', 'c-text-0 flex-center r-5 cursor-pointer btn-text border-none disabled:opacity-50 disabled:cursor-not-allowed'],
['btn-primary', 'btn bg-primary'],
['btn-success', 'btn bg-success'],
['btn-danger', 'btn bg-danger'],
['btn-text', 'btn bg-text c-text-3'],
['bg-primary', 'bgc-5865f2 hover:bgc-4752c4 active:bgc-3c45a5'],
['bg-success', 'bgc-248046 hover:bgc-1a6334 active:bgc-15562b'],
['bg-danger', 'bgc-da373c hover:bgc-a12828 active:bgc-8f2022'],
['bg-text', 'bgc-b8b9bf hover:bgc-e0e1e5 active:bgc-ffffff'],
['c-change-1', 'c-text-1 hover:c-text-0 transition-280'],
['c-change-2', 'c-text-2 hover:c-text-1 transition-280'],
['c-change-3', 'c-text-3 hover:c-text-1 transition-280'],
],
rules: [
[
'scroll-y',
{
'overflow-y': 'scroll',
},
],
['btn-text',
{
'white-space': 'nowrap',
'text-overflow': 'ellipsis',
'font-weight': 700,
},
],
[
'scroll-x',
{
'overflow-x': 'scroll',
},
],
['c-text-0', { color: '#ffffff' }],
['c-text-1', { color: '#f3f4f5' }],
['c-text-2', { color: '#e0e1e5' }],
['c-text-3', { color: '#b8b9bf' }],
[/^wp-(\d+)$/, ([, d]) => ({ width: `${d}%` })],
[/^hp-(\d+)$/, ([, d]) => ({ height: `${d}%` })],
[/^r-(\d+)$/, ([, d]) => ({ 'border-radius': `${d}px` })],
[/^bgc-([0-9a-zA-z]+)$/, ([, s]) => ({ 'background-color': `#${s}` })],
[/^c-([0-9a-zA-z]+)$/, ([, s]) => ({ color: `#${s}` })],
[/^s-(\w+)$/, ([, w]) => ({ height: w, width: w })],
],
presets: [
presetUno(),
presetAttributify(),
presetIcons({
scale: 1.2,
warn: true,
collections: {
carbon: () =>
import('@iconify-json/carbon/icons.json').then(i => i.default as any),
tabler: () => import('@iconify-json/tabler/icons.json').then(i => i.default as any),
},
}),
presetWebFonts({
fonts: {
serif: 'DM Serif Display',
mono: 'DM Mono',
},
}),
],
})