-
Notifications
You must be signed in to change notification settings - Fork 1
/
uno.config.ts
30 lines (29 loc) · 897 Bytes
/
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
import {defineConfig, presetUno} from 'unocss'
import presetIcons from '@unocss/preset-icons'
import {FileSystemIconLoader} from '@iconify/utils/lib/loader/node-loaders'
// noinspection ES6PreferShortImport
import {iconList} from './src/components/special/icon/project-icon'
const whRegex = /(width|height)="\d+(\.\d+)?px"\s?/g
export default defineConfig({
presets: [
presetUno(),
presetIcons({
extraProperties: {
display: 'inline-block',
'vertical-align': '-0.125em'
},
collections: {
'ly': FileSystemIconLoader('./src/assets/svg-icon', svg => svg.replace(whRegex, ''))
},
customizations: {
iconCustomizer(collection, icon, props) {
if (collection === 'ly') {
props.width = '14px'
props.height = '14px'
}
}
}
})
],
safelist: iconList.map(it=>`i-${it}`)
})