Skip to content

Ekstraktor Svelte

Obsługuje ekstrahowanie klas z dyrektywy class:.

svelte
<div class:text-orange-400={foo} />

Zostanie wyekstrahowane jako text-orange-400 i wygeneruje:

css
.text-orange-400 {
  color: #f6993f;
}

Instalacja

bash
pnpm add -D @unocss/extractor-svelte
bash
yarn add -D @unocss/extractor-svelte
bash
npm install -D @unocss/extractor-svelte
bash
bun add -D @unocss/extractor-svelte
ts
import extractorSvelte from '@unocss/extractor-svelte'
import { defineConfig } from 'unocss'

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

Released under the MIT License.