import presetWeapp from "unocss-preset-weapp"; import { extractorAttributify, transformerClass } from "unocss-preset-weapp/transformer"; const { presetWeappAttributify, transformerAttributify } = extractorAttributify(); export default { presets: [ // https://github.com/MellowCo/unocss-preset-weapp presetWeapp(), // attributify autocomplete presetWeappAttributify(), ], // 只保留实际复用的组合;语义色直接用 color-* 类,其余交给 presetWeapp 自带规则 // flex-* 系列固定 flex 方向并统一交叉轴居中,需要其他对齐时直接写工具类 shortcuts: [ { "flex-center": "flex justify-center items-center", "flex-start": "flex justify-start items-center", "flex-end": "flex justify-end items-center", "flex-between": "flex justify-between items-center", }, ], transformers: [ // https://github.com/MellowCo/unocss-preset-weapp/tree/main/src/transformer/transformerAttributify transformerAttributify(), // https://github.com/MellowCo/unocss-preset-weapp/tree/main/src/transformer/transformerClass transformerClass(), ], };