Skip to content

任意变体提取器

¥Arbitrary Variants Extractor

更复杂的提取器,支持工具的任意变体。

¥A more complex extractor to support arbitrary variants for utilities.

html
<div class="[&>*]:m-1 [&[open]]:p-2"></div>

将以 [&>*]:m-1[&[open]]:p-2 作为变体捕获。

¥Will be captured with [&>*]:m-1 and [&[open]]:p-2 as variants.

该提取器作为默认提取器包含在 @unocss/preset-mini 中。通常你不需要手动安装此软件包。

¥This extractor is included in @unocss/preset-mini as the default extractor. Normally you don't need to install this package manually.

安装

¥Installation

bash
pnpm add -D @unocss/extractor-arbitrary-variants
bash
yarn add -D @unocss/extractor-arbitrary-variants
bash
npm install -D @unocss/extractor-arbitrary-variants
uno.config.ts
ts
import extractorArbitrary from '@unocss/extractor-arbitrary-variants'
import { defineConfig } from 'unocss'

export default defineConfig({
  extractors: [
    extractorArbitrary(),
  ],
})