// uno.config.ts import { type Preset, defineConfig, presetUno, presetAttributify, presetIcons, transformerDirectives, transformerVariantGroup, } from 'unocss' import { presetApplet, presetRemRpx, transformerAttributify } from 'unocss-applet' // @see https://unocss.dev/presets/legacy-compat import { presetLegacyCompat } from '@unocss/preset-legacy-compat' const isMp = process.env?.UNI_PLATFORM?.startsWith('mp') ?? false const presets: Preset[] = [] if (isMp) { // 使用小程序预设 presets.push(presetApplet(), presetRemRpx()) } else { presets.push( // 非小程序用官方预设 presetUno(), // 支持css class属性化 presetAttributify(), ) } export default defineConfig({ presets: [ ...presets, // 支持图标,需要搭配图标库,eg: @iconify-json/carbon, 使用 `