forked from anse-app/anse
-
Notifications
You must be signed in to change notification settings - Fork 0
/
unocss.config.ts
143 lines (133 loc) · 5.43 KB
/
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
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
import {
defineConfig,
presetAttributify,
presetIcons,
presetTypography,
presetUno,
transformerDirectives,
transformerVariantGroup,
} from 'unocss'
export default defineConfig({
presets: [
presetUno({
dark: 'class',
}),
presetAttributify(),
presetIcons(),
presetTypography({
cssExtend: {
'h1': {
'font-size': '1.25em',
'margin': '1rem 0',
},
'h2': {
'font-size': '1.16em',
'margin': '1rem 0',
},
'h3': {
'font-size': '1.1em',
'margin': '1rem 0',
},
'h4, h5, h6': {
'font-size': '1em',
'margin': '1rem 0',
},
':not(pre) > code': {
'font-weight': 400,
'padding': '0 0.2em',
'color': 'var(--prism-keyword)',
},
},
}),
],
transformers: [transformerVariantGroup(), transformerDirectives()],
shortcuts: [{
'bg-base': 'bg-light-100 dark:bg-[#1c1c1c]',
'bg-base-100': 'bg-light-200 dark:bg-[#222222]',
'bg-blur': 'bg-light-200/85 dark:bg-[#222222]/85 backdrop-blur-xl backdrop-saturate-150',
'bg-sidebar': 'bg-light-400 dark:bg-[#191919]',
'bg-modal': 'bg-base dark:bg-base-100',
'bg-darker': 'bg-black/4 dark:bg-white/4',
'fg-base': 'text-dark dark:text-[#dadada]',
'border-base': 'border-black/8 dark:border-white/8',
'border-b-base': 'border-b-black/8 dark:border-b-white/8',
'border-lighter': 'border-light-600 dark:border-dark-300',
'border-darker': 'border-black/50 dark:border-white/50',
'placeholder-base': 'placeholder:op-50 dark:placeholder:op-30',
'hv-base': 'transition-colors cursor-pointer hover:bg-darker',
'hv-foreground': 'transition-opacity cursor-pointer op-70 hover:op-100',
'input-base': 'bg-transparent placeholder:op-50 dark:placeholder:op-20 focus:(ring-0 outline-none) resize-none',
'button': 'mt-4 px-3 py-2 text-xs border border-base rounded-lg hv-base hover:border-darker',
'max-w-base': 'max-w-3xl mx-auto',
'text-error': 'text-red-700 dark:text-red-400/80',
'border-error': 'border border-red-700 dark:border-red-400/80',
'text-info': 'text-gray-400 dark:text-gray-200',
'menu-icon': 'cursor-pointer text-base fg-base hover-text-emerald-600',
'fc': 'flex justify-center',
'fi': 'flex items-center',
'fcc': 'fc items-center',
'fb': 'flex justify-between',
// TODO: remove below
'fie': 'fi justify-end',
'col-fcc': 'flex-col fcc',
'inline-fcc': 'inline-flex items-center justify-center',
'base-focus': 'focus:(bg-op-20 ring-0 outline-none)',
'b-slate-link': 'border-b border-(slate none) hover:border-dashed',
'gpt-title': 'text-2xl font-extrabold mr-1',
'gpt-subtitle': 'text-(2xl transparent) font-extrabold bg-(clip-text gradient-to-r) from-sky-400 to-emerald-600',
'gpt-copy-btn': 'absolute top-12px right-12px z-3 fcc border b-transparent w-8 h-8 p-2 bg-light-300 dark:bg-dark-300 op-90 cursor-pointer',
'gpt-copy-tips': 'op-0 h-7 bg-black px-2.5 py-1 box-border text-xs c-white fcc rounded absolute z-1 transition duration-600 whitespace-nowrap -top-8',
'gpt-retry-btn': 'fi gap-1 px-2 py-0.5 op-70 border border-slate rounded-md text-sm cursor-pointer hover:bg-slate/10',
'gpt-back-top-btn': 'fcc p-2.5 text-base rounded-md hover:bg-slate/10 fixed bottom-60px right-20px z-10 cursor-pointer transition-colors',
'gpt-back-bottom-btn': 'gpt-back-top-btn bottom-20px transform-rotate-180deg',
'gpt-password-input': 'px-4 py-3 h-12 rounded-sm bg-(slate op-15) base-focus',
'gpt-password-submit': 'fcc h-12 w-12 bg-slate cursor-pointer bg-op-20 hover:bg-op-50',
'gen-slate-btn': 'h-12 px-4 py-2 bg-(slate op-15) hover:bg-op-20 rounded-sm',
'gen-cb-wrapper': 'h-12 my-4 fcc gap-4 bg-(slate op-15) rounded-sm',
'gen-cb-stop': 'px-2 py-0.5 border border-slate rounded-md text-sm op-70 cursor-pointer hover:bg-slate/10',
'gen-text-wrapper': 'my-4 fc gap-2 transition-opacity',
'gen-textarea': 'w-full px-3 py-3 min-h-12 max-h-36 rounded-sm bg-(slate op-15) resize-none base-focus placeholder:op-50 dark:(placeholder:op-30) scroll-pa-8px',
'sys-edit-btn': 'inline-fcc gap-1 text-sm bg-slate/20 px-2 py-1 rounded-md transition-colors cursor-pointer hover:bg-slate/50',
'gpt-toggle-wrapper': 'inline-flex rounded border border-gray-100 bg-gray-100 p-1 cursor-pointer',
'gpt-toggle-item': 'inline-block rounded font-semibold px-2 py-1 text-xs text-gray-500 focus:relative',
'gpt-toggle-active': 'bg-emerald-500 text-white',
'icon-base': 'md:(w-6 h-6) w-5 h-5',
'icon--off': 'group-hover:hidden inline-block',
'icon--on': 'hidden group-hover:inline-block',
}],
preflights: [{
layer: 'base',
getCSS: () => `
:root {
--c-scroll: #d9d9d9;
--c-scroll-hover: #bbbbbb;
--c-shadow: #00000008;
}
html.dark {
--c-scroll: #333333;
--c-scroll-hover: #555555;
--c-shadow: #ffffff08;
}
::-webkit-scrollbar {
width: 4px;
height: 4px;
}
::-webkit-scrollbar-thumb {
background-color: var(--c-scroll);
}
::-webkit-scrollbar-thumb:hover {
background-color: var(--c-scroll-hover);
}
::selection {
background: rgba(0, 0, 0, 0.12);
}
.dark ::selection {
background: rgba(255, 255, 255, 0.12);
}
button,select,input,option {
outline: none;
-webkit-appearance: none
}
`,
}],
})