-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathuno.config.ts
64 lines (60 loc) · 1.49 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
// uno.config.ts
import { defineConfig } from 'unocss';
export default defineConfig({
theme: {
colors: {
red: {
400: '#F5827A',
500: '#EF3122',
600: '#E01E10',
},
yellow: {
400: '#FED352',
500: '#FEC210',
600: '#EAAF01',
},
blue: {
400: '#00D1D1',
500: '#00B8B9',
600: '#00A8A8',
},
green: {
400: '#29D159',
500: '#23B24B',
600: '#20A245',
},
gray: {
400: '#D6D6D6',
500: '#CCCCCC',
600: '#A3A3A3',
},
white: '#ffffff',
black: '#110A0C',
},
},
variants: [
(matcher) => {
if (!matcher.startsWith('hover:')) return matcher;
return {
matcher: matcher.slice(6),
selector: (s) => `${s}:hover`,
};
},
],
rules: [
[
/^overflow-(x|y)-(auto|hidden|scroll)$/,
([_, direction, option]) => ({ [`overflow-${direction}`]: option }),
],
[/^text-lg/, () => ({ 'font-size': '1.5rem', 'line-height': '2rem' })],
[/^bold-([\.\d]+)$/, ([_, num]) => ({ 'font-weight': `${num}` })],
[/^p-([\.\d]+)$/, ([_, num]) => ({ padding: `${num}px` })],
[/^py-([\.\d]+)$/, ([_, num]) => ({ padding: `${num}px 0` })],
[/^px-([\.\d]+)$/, ([_, num]) => ({ padding: `0 ${num}px` })],
[/^rounded-([\.\d]+)$/, ([_, num]) => ({ 'border-radius': `${num}px` })],
],
shortcuts: {
'title-1': 'bold-500 text-lg',
'title-2': 'bold-500 text-base',
},
});