-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuno.config.ts
69 lines (65 loc) · 1.53 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
// uno.config.ts
import presetAttributify from '@unocss/preset-attributify'
import presetIcons from '@unocss/preset-icons'
import presetMini from '@unocss/preset-mini'
import transformerDirectives from '@unocss/transformer-directives'
import presetRemToPx from '@unocss/preset-rem-to-px'
import { defineConfig, presetWind3 } from 'unocss'
export default defineConfig({
rules: [
[
'flex-center',
{
display: 'flex',
'justify-content': 'center',
'align-items': 'center'
}
],
[/^size-(\d)px$/, ([, d]) => ({ width: `${d}px` })]
],
variants: [
// not first or last
matcher => {
const tags = [
{
name: 'not-first:',
selector: ':not(:first-child)'
},
{
name: 'not-last:',
selector: ':not(:last-child)'
}
]
for (let i = 0; i < tags.length; i++) {
const tag = tags[i]
if (!matcher.startsWith(tag.name)) {
continue
}
return {
matcher: matcher.slice(tag.name.length),
selector: s => `${s}${tag.selector}`
}
}
return matcher
}
],
presets: [
presetWind3(),
presetAttributify(),
presetIcons({
scale: 1
}),
presetMini(),
presetRemToPx()
],
transformers: [
transformerDirectives({
applyVariable: ['--at-apply', '--style']
})
],
content: {
pipeline: {
exclude: ['node_modules', 'dist', '.git', '.husky', '.vscode', 'public', 'build', 'mock', './stats.html']
}
}
})