代码拉取完成,页面将自动刷新
// uno.config.js
import { defineConfig, presetAttributify, presetUno, presetIcons } from 'unocss'
import presetRemToPx from '@unocss/preset-rem-to-px'
import { FileSystemIconLoader } from '@iconify/utils/lib/loader/node-loaders'
export default defineConfig({
presets: [
presetUno(), // 默认样式预设, 此预设继承了 @unocss/preset-wind 和 @unocss/preset-mini
presetAttributify(), // 为其他预设和规则提供归因模式。 标签class类名可写为属性
presetRemToPx({
// 将 rem 转为 px , 1rem = n px
baseFontSize: 4, // 默认为 16
}),
presetIcons({
prefix: 'i-',
collections: {
ep: () => import('@iconify-json/ep/icons.json').then((i) => i.default),
ct: FileSystemIconLoader('./src/assets/svg/', (svg) => svg.replace(/#FFF/, 'currentColor')),
},
extraProperties: {
display: 'inline-block',
},
warn: true,
}),
],
shortcuts: [
['wh-full', 'w-full h-full'],
['flex-x-center', 'flex justify-center'],
['flex-y-center', 'flex items-center'],
['flex-center', 'flex justify-center items-center'],
['flex-x-between', 'flex items-center justify-between'],
['flex-col', 'flex flex-col'],
['text-ellipsis', 'truncate'],
[
'icon-btn',
'text-16 inline-block cursor-pointer select-none opacity-75 transition duration-200 ease-in-out hover:opacity-100 hover:text-primary !outline-none',
],
],
rules: [
[/^bc-(.+)$/, ([, color]) => ({ 'border-color': `#${color}` })],
['card-shadow', { 'box-shadow': '0 1px 2px -2px #00000029, 0 3px 6px #0000001f, 0 5px 12px 4px #00000017' }],
],
theme: {
// colors: {
// primary: 'var(--primary-color)',
// dark_bg: 'var(--dark-bg)',
// },
},
content: {
pipeline: {
include: [
// the default
/\.(vue|svelte|[jt]sx|mdx?|astro|elm|php|phtml|html)($|\?)/,
// include js/ts files
'src/constant/icons.ts',
],
// exclude files
// exclude: []
},
},
})
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。