-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuno.config.js
54 lines (53 loc) · 1.99 KB
/
uno.config.js
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
import {
defineConfig,
presetAttributify,
presetTypography,
presetUno,
presetWebFonts,
transformerDirectives,
transformerVariantGroup,
} from 'unocss'
import presetIcons from '@unocss/preset-icons'
export default defineConfig({
rules: [
['block', { display: 'block !important' }],
[/^bg--([\w-]+)$/, ([, w]) => ({ background: `hsl(var(--${w},0,0%,0%))` })],
[/^bg--([\w-]+)\/(\d+)$/, ([, w, d]) => ({ background: `hsla(var(--${w},0,0%,0%),${+d / 100})` })],
[/^text--([\w-]+)$/, ([, w]) => ({ color: `hsl(var(--${w},0,0%,0%))` })],
[/^color--([\w-]+)$/, ([, w]) => ({ color: `hsl(var(--${w},0,0%,0%))` })],
[/^fill--([\w-]+)$/, ([, w]) => ({ fill: `hsl(var(--${w},0,0%,0%))` })],
[/^stroke--([\w-]+)$/, ([, w]) => ({ stroke: `hsl(var(--${w},0,0%,0%))` })],
[/^border--([\w-]+)$/, ([, w]) => ({ 'border-color': `hsl(var(--${w},0,0%,0%))` })],
[/^border--([\w-]+)\/(\d+)$/, ([, w, d]) => ({ 'border-color': `hsla(var(--${w},0,0%,0%),${+d / 100})` })],
['max-w-fill', { 'max-width': '-webkit-fill-available' }],
[/^ring--(\w+)$/, ([, w]) => ({ '--un-ring-color': `hsl(var(--${w},0,0%,0%))` })],
[/^ring--([\w-]+)\/(\d+)$/, ([, w, d]) => ({ '--un-ring-color': `hsla(var(--${w},0,0%,0%),${+d / 100})` })],
['ring-inner', { 'box-shadow': 'inset var(--un-ring-offset-shadow),inset var(--un-ring-shadow), var(--un-shadow) !important' }],
['text-vertical', { 'writing-mode': 'vertical-lr' }],
],
shortcuts: [
{ tween: 'transition ease-in-out duration-300' },
[/^tween-(\d+)$/, ([, d]) => `transition ease-in-out duration-${d}`],
],
presets: [
presetUno(),
presetAttributify(),
presetIcons({
scale: 1.2,
warn: true,
}),
presetTypography(),
presetWebFonts({
fonts: {
sans: 'DM Sans',
serif: 'DM Serif Display',
mono: 'DM Mono',
},
}),
],
transformers: [
transformerDirectives(),
transformerVariantGroup(),
],
safelist: 'prose prose-sm m-auto text-left'.split(' '),
})