代码拉取完成,页面将自动刷新
import {
defineConfig,
presetAttributify,
presetIcons,
presetTypography,
presetWebFonts,
presetWind3,
transformerDirectives,
transformerVariantGroup,
} from 'unocss'
import { FileSystemIconLoader } from 'unplugin-icons/loaders'
export default defineConfig({
shortcuts: [
// ...
],
theme: {
colors: {
// ...
},
},
presets: [
presetWind3(),
presetAttributify({
ignoreAttributes: ['color', 'boder', 'size', 'align'],
}),
presetIcons({
warn: true, // 如果图标名称无效,是否给出警告
prefix: ['usvg-'], // 图标名称前缀,例如 i-home
extraProperties: {
'display': 'inline-block',
'vertical-align': 'middle',
'width': '1em',
'height': '1em',
},
collections: {
custom: FileSystemIconLoader('./assets/svgs', svg => svg.replace(/(<svg.*?fill=)"(.*?)"/, '$1"currentColor"')),
// , svg => svg.replace(/(<svg.*?fill=)"(.*?)"/, '$1"currentColor"')
// replace(/(<svg.*?fill=)"(.*?)"/, '$1"currentColor"')
// 使用 em 单位才能实现通过修改字体大小
},
}),
presetTypography(),
presetWebFonts({
fonts: {
// ...
},
}),
],
transformers: [
transformerDirectives({ enforce: 'pre' }),
transformerVariantGroup(),
],
})
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。