-
Notifications
You must be signed in to change notification settings - Fork 19
/
unocss.config.ts
55 lines (51 loc) · 1.19 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
import {
defineConfig,
presetAttributify,
presetIcons,
presetTypography,
presetUno,
transformerDirectives,
transformerVariantGroup,
} from 'unocss'
import path from 'path'
import fs from 'fs'
export default defineConfig({
shortcuts: [
[
'icon-btn',
'inline-block cursor-pointer select-none opacity-75 scale-155 transition duration-200 ease-in-out hover:opacity-100 hover:text-teal-600',
],
['card-grid', 'grid grid-cols-1 sm:grid-cols-2 xl:grid-cols-3 gap-8'],
],
presets: [
presetUno(),
presetAttributify(),
presetTypography(),
presetIcons({
scale: 1.2,
warn: true,
collections: {
custom: getCustomIcons(),
},
}),
],
theme: {
colors: {
primary: 'var(--vp-c-brand)',
},
},
transformers: [transformerDirectives(), transformerVariantGroup()],
safelist: 'prose prose-sm m-auto text-left'.split(' '),
})
function getCustomIcons() {
const data = {}
fs.readdirSync(
path.resolve(__dirname, './src/public/imgs/svg'),
).forEach((val) => {
data[val.replace('.svg', '')] = fs.readFileSync(
path.resolve(__dirname, './src/public/imgs/svg/' + val),
'utf8',
)
})
return data
}