Skip to content

Directives transformer

UnoCSS transformer voor @apply, @screen en theme() directives: @unocss/transformer-directives.

Installatie

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

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

TIP

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

ts
import { transformerDirectives } from 'unocss'

Gebruik

@apply

css
.custom-div {

Released under the MIT License.