-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuno.config.ts
147 lines (143 loc) · 3.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
import {
defineConfig,
presetTypography,
presetUno,
presetIcons,
transformerDirectives,
} from 'unocss';
import tinycolor from 'tinycolor2';
export default defineConfig({
safelist: [
'animate-order-0',
'animate-order-1',
'animate-order-2',
'animate-order-3',
'animate-order-4',
'bg-primary',
'bg-secondary',
'bg-selection',
'bg-accent',
'bg-success',
'bg-warning',
'bg-error',
'bg-link',
],
content: {
pipeline: {
include: [
// the default
/\.(vue|svelte|[jt]sx|mdx?|html)($|\?)/,
// include js/ts files
'src/**/*.{js,ts}',
],
},
},
presets: [
presetUno(),
presetTypography(),
presetIcons({
extraProperties: {
display: 'inline-block',
height: '1.2em',
width: '1.2em',
'vertical-align': 'text-bottom',
},
}),
],
transformers: [transformerDirectives()],
shortcuts: [
{
'icon-search': 'i-ph-magnifying-glass',
'icon-mac-cmd': 'i-fluent-key-command-24-regular',
'icon-ctrl': 'i-fluent-control-button-24-regular',
'icon-close': 'i-mdi-close',
'icon-fullscreen': 'i-mdi-fullscreen',
hoverable: 'transition-shadow @hover:bg-lighten',
'if-disabled': 'disabled:bg-lighten disabled:text-gray',
'core-btn':
'transition-colors cursor-pointer rounded-lg px-2 py-1 decoration-none hoverable flex items-center justify-center if-disabled',
},
[
/fe-border$|fe-border-(x|y|b|t|l|r)$/,
([, b]) => {
const borderClass = b ? `border-${b}` : `border`;
return `${borderClass} ${borderClass}-light-selection dark:${borderClass}-dark-selection`;
},
],
[
/^(\w+)-(primary|secondary|accent|error|link|selection|background|foreground|success|warning|button)$/,
([, b, c]) => `${b}-light-${c} dark:${b}-dark-${c}`,
],
],
rules: [
[
'bg-lighten',
{
'-moz-box-shadow': 'inset 0 0 100px 100px rgba(121, 126, 154, 0.2)',
'-webkit-box-shadow': 'inset 0 0 100px 100px rgba(121, 126, 154, 0.2)',
'box-shadow': 'inset 0 0 100px 100px rgba(121, 126, 154, 0.2)',
},
],
[
'font-body-1',
{
'font-family': "'Open Sans Variable', sans-serif",
},
],
[
'font-header',
{
'font-family': "'Fira Code Variable', monospace",
},
],
[
/^bg-(dark|light)-(.*)$/,
([, m, c], { theme }) => {
if (theme.colors[m][c]) {
return {
color: tinycolor(theme.colors[m][c]).isDark()
? '#ffffff'
: '#000000',
'background-color': theme.colors[m][c],
};
}
},
],
[
/animate-order-(\d+)/,
([, n]) => ({
'--animation-order': n,
}),
],
],
theme: {
colors: {
dark: {
background: '#282a36',
foreground: '#f8f8f2',
button: '#000000',
selection: '#44475a',
accent: '#8be9fd',
success: '#50fa7b',
primary: '#ff79c6',
warning: '#f1fa8c',
secondary: '#bd93f9',
error: '#ff5555',
link: '#f1fa8c',
},
light: {
background: '#FFFFFF',
foreground: '#3D4752',
button: '#FFFFFF',
selection: '#E6E6E6',
accent: '#70A4B9',
success: '#05977D',
primary: '#E05C84',
warning: '#D67D00',
secondary: '#640BE0',
error: '#CB2735',
link: '#AD6500',
},
},
},
});