-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuno.config.ts
105 lines (100 loc) · 3.24 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
import {
defineConfig,
presetAttributify,
presetIcons,
presetTypography,
presetUno,
presetWebFonts,
transformerDirectives,
transformerVariantGroup,
} from 'unocss'
export default defineConfig({
rules: [
// Typography
['text-btn', { 'font-size': '1rem', 'font-weight': '700', 'line-height': '125%' }],
// Action focus outline style
['menu-focus', { 'outline': '2px solid #19a7ce', 'outline-offset': '4px', 'border-radius': '0.25rem' }],
['inside-focus', { 'outline': '2px solid #19a7ce', 'outline-offset': '-2px' }],
['action-focus', { 'outline': '2px solid inherit', 'outline-offset': '2px' }],
// Truncature
[/^truncate-(\d+)$/, ([, d]) => ({
'overflow': 'hidden',
'text-overflow': 'ellipsis',
'display': '-webkit-box',
'-webkit-box-orient': 'vertical',
'-webkit-line-clamp': `${d}`,
})],
],
shortcuts: {
'text-color': 'color-black dark:color-white',
'bg-input': 'bg-lightgrey/30 dark:bg-darkgrey',
'bg-base': 'bg-white dark:bg-darkbg',
'bg-inverse': 'bg-darkbg dark:bg-white',
'border-base': 'border border-[#cccccc] dark:border-grey rounded',
'btn-base': 'relative h-10 px-4 py-2 inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors focus-visible:action-focus appearance-none ws-nowrap disabled:pointer-events-none disabled:opacity-50',
// Layout
'grid-layout': 'grid grid-cols-4 gap-4 md:(grid-cols-12 gap-4)',
// Buttons
'btn': 'btn-base bg-primary text-white hover:bg-primary/90',
'btn-danger': 'btn-base bg-danger text-white hover:bg-danger/90',
'btn-secondary': 'btn-base bg-inherit border-2 border-primary text-color hover:bg-secondary/10',
'btn-icon': 'btn-base px-2 bg-transparent hover:bg-primary/20',
'btn-icon-inverse': 'btn-icon text-white dark:(text-black)',
'btn-link': 'bg-transparent hover:bg-primary/20 rounded-md transition-colors focus-visible:action-focus appearance-none disabled:pointer-events-none disabled:opacity-50',
'btn-small': 'h-8 px-3 text-xs',
'btn--loading': 'relative pointer-events-none important:pr-9.5 after:border-inherit after:border-r-transparent',
},
presets: [
presetUno(),
presetIcons({
customizations: {
iconCustomizer(collection, icon, props) {
props.width = '1.25rem'
props.height = '1.25rem'
},
},
}),
presetAttributify(),
presetWebFonts({
provider: 'bunny',
fonts: {
sans: 'DM Sans',
mono: 'DM Mono',
},
}),
presetTypography(),
],
transformers: [
transformerDirectives(),
transformerVariantGroup(),
],
theme: {
fontFamily: {
sans: 'DM Sans',
},
colors: {
'primary': '#19a7ce',
'secondary': '#999999',
'neutral': '#6498e5',
'success': '#4caf50',
'success-bg': '#e8f5e9',
'warning': '#ff9800',
'warning-bg': '#fff3e0',
'danger': '#e87975',
'danger-bg': '#f8e4de',
'grey': '#4d4d4d',
'darkgrey': '#323232',
'lightgrey': '#cccccc',
'darkbg': '#262626',
},
breakpoints: {
// xs: '320px',
// sm: '640px',
md: '768px',
lg: '1024px',
xl: '1280px',
// "2xl": "1536px",
// "xxl": "1536px"
},
},
})