-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuno.config.mjs
More file actions
88 lines (85 loc) · 2.34 KB
/
uno.config.mjs
File metadata and controls
88 lines (85 loc) · 2.34 KB
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
// why this file? - https://github.com/unocss/unocss/discussions/2280
import { defineConfig, presetUno, presetTypography } from 'unocss';
import presetIcons from '@unocss/preset-icons';
import { presetDaisy } from 'unocss-preset-daisy';
const bitWidth = 1.5;
export default defineConfig({
presets: [
presetIcons({
/* options */
}),
presetUno(),
presetDaisy(),
presetTypography(),
],
// use `safelist` to include ones that are not scanned from static analysis
safelist: [
'w-bit',
'w-hex',
'w-octal',
'w-bit-sm',
'w-hex-sm',
'bg-yellow-200',
'opacity-0',
'opacity-50',
'opacity-100',
],
// or include something like this in individual component so it can be scanned <!-- <unocss-safelist class="bg-yellow-200 text-gray-800" /> -->
shortcuts: [
// somehow without `safelist`, shortcuts are not being recognized at the moment
{
'w-bit': `w-${bitWidth}rem`,
'w-octal': `w-${bitWidth * 3}rem`,
'w-hex': `w-${bitWidth * 4}rem`,
'w-bit-sm': `w-${bitWidth / 1.5}rem`,
'w-hex-sm': `w-${(bitWidth * 4) / 1.5}rem`,
'math-inline': 'inline-block text-sm',
'icon-link': 'i-bi-link-45deg inline-block align-middle text-slate-300',
'digit-border-common': 'border-0 border-l-2 first:border-l-0',
'digit-border-hex': 'border-slate-200 border-solid',
'digit-border-octal': 'border-slate-300 border-dashed',
'input-number-hide-arrows':
'[appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none',
},
],
rules: [
[
// e.g. `mlv-[my-var]`
/^mlv-\[([a-z|-]+)\]$/,
([, v]) => ({
'margin-left': `var(--${v})`,
}),
],
[
// e.g. `w-1.5rem`
/^w-(\d+(\.\d+)?)rem$/,
([, n]) => ({
width: `${n}rem`,
'min-width': `${n}rem`,
'max-width': `${n}rem`,
}),
],
],
preflights: [
{
getCSS: () => `
h1 {
font-size: 1.25rem; /* 18px */
line-height: 1.75rem; /* 28px */
}
`,
},
],
theme: {
// based on https://tailwindcss.com/docs/responsive-design
// and basically adding my custom `xs`
breakpoints: {
xs: '384px',
sm: '640px',
md: '768px',
lg: '1024px',
xl: '1280px',
'2xl': '1536px',
},
},
});