Skip to content

pantoken / bundlers/tailwind/src / pantokenPreset

函式: pantokenPreset()

pantokenPreset(options?): TailwindPreset

實驗性

建置 pantoken 的 Tailwind 預設套件。

參數

options?

PantokenPresetOptions = {}

PantokenPresetOptions.

回傳

TailwindPreset

一個 Tailwind 預設套件,提供 colorsspacingfontFamily

範例

在 tailwind.config.ts 中註冊該預設

ts
import { pantokenPreset } from "@pantoken/tailwind";

export default {
  presets: [pantokenPreset()],
  content: ["./src/**/*.{ts,tsx}"],
};
// then use utilities like `bg-color-background-base p-space-md`

同時在 primitive- 前綴下暴露 primitive 調色盤

ts
import { pantokenPreset } from "@pantoken/tailwind";

export default {
  presets: [pantokenPreset({ includePrimitives: true })],
};