代码拉取完成,页面将自动刷新
import {
defineConfig,
presetAttributify,
presetIcons,
presetUno,
transformerAttributifyJsx,
transformerDirectives,
} from 'unocss'
import { presetScalpel } from 'unocss-preset-scalpel'
import { FileSystemIconLoader } from '@iconify/utils/lib/loader/node-loaders'
export default defineConfig({
shortcuts: {
'flex-center': 'flex justify-center items-center',
'btn': 'px-4 py-1 rounded inline-block bg-$primary-c text-white cursor-pointer hover:bg-$primary-light-c active:bg-$primary-dark-c disabled:cursor-default disabled:bg-gray-600 disabled:opacity-50 transition-300 duration-200',
'icon-btn': 'text-16 inline-block cursor-pointer select-none opacity-75 transition duration-200 ease-in-out hover:opacity-100 hover:text-$primary-c',
},
rules: [
[
/^ellipsis-(\d+)$/,
([, n]) => ({
'overflow': 'hidden',
'text-overflow': 'ellipsis',
'display': ' -webkit-box',
'-webkit-line-clamp': `${n}`,
'-webkit-box-orient': 'vertical',
}),
],
],
presets: [
presetUno(),
presetAttributify(),
presetIcons({
scale: 1.2,
collections: {
cus: FileSystemIconLoader('./public/svg'),
},
}),
presetScalpel(),
],
transformers: [
transformerDirectives(),
transformerAttributifyJsx(),
],
})
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。