Skip to content

Compile class transformer

Compileer groep van classes naar één class. Geïnspireerd door de compilation mode van Windi CSS en issue #948 door @UltraCakeBakery.

Installatie

bash
pnpm add -D @unocss/transformer-compile-class
bash
yarn add -D @unocss/transformer-compile-class
bash
npm install -D @unocss/transformer-compile-class
bash
bun add -D @unocss/transformer-compile-class
ts
import transformerCompileClass from '@unocss/transformer-compile-class'
import { defineConfig } from 'unocss'

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

TIP

Deze preset is opgenomen in het unocss pakket, je kunt het ook vandaar importeren:

ts
import { transformerCompileClass } from 'unocss'

Gebruik

Voeg :uno: toe aan het begin van de class strings om ze te markeren voor compilatie.

Released under the MIT License.