Skip to content

变体组转换器

¥Variant group transformer

为 UnoCSS 启用 Windi CSS 的 变体组特性

¥Enables the variant group feature of Windi CSS for UnoCSS.

安装

¥Installation

bash
pnpm add -D @unocss/transformer-variant-group
bash
yarn add -D @unocss/transformer-variant-group
bash
npm install -D @unocss/transformer-variant-group
ts
// uno.config.ts
import { defineConfig } from 'unocss'
import transformerVariantGroup from '@unocss/transformer-variant-group'

export default defineConfig({
  // ...
  transformers: [
    transformerVariantGroup(),
  ],
})

用法

¥Usage

html
<div class="hover:(bg-gray-400 font-medium) font-(light mono)"/>

将转变为:

¥Will be transformed to:

html
<div class="hover:bg-gray-400 hover:font-medium font-light font-mono"/>

许可

¥License