Back to Unocss

Core

docs/tools/core.md

66.6.8651 B
Original Source

Core

The core engine of UnoCSS without any presets: @unocss/core. It can be used as the engine of your own atomic CSS framework.

Installation

::: code-group

bash
pnpm add -D @unocss/core
bash
yarn add -D @unocss/core
bash
npm install -D @unocss/core
bash
bun add -D @unocss/core

:::

Usage

ts
import { createGenerator } from '@unocss/core'

const generator = await createGenerator(
  { /* user options */ },
  { /* default options */ }
)

const { css } = await generator.generate(code)

License