Files
family-mp/unocss.config.ts
2026-09-06 16:07:53 +08:00

20 lines
716 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { defineConfig } from 'unocss'
import presetWeapp from 'unocss-preset-weapp'
import { extractorAttributify, transformerClass } from 'unocss-preset-weapp/transformer'
const { presetWeappAttributify, transformerAttributify } = extractorAttributify()
export default defineConfig({
presets: [
presetWeapp(), // 小程序预设,默认单位 rpxw-100 => width:100rpx
presetWeappAttributify()
],
shortcuts: {
center: 'flex justify-center items-center',
'btn-primary': 'bg-blue-500 text-white rounded'
},
transformers: [
transformerAttributify(),
transformerClass() // 解决小程序不支持 \ : [ ] $ 等特殊字符
]
})