Skip to content

pantoken-root / bundlers/tailwind/src / pantokenPreset

函式: pantokenPreset() ​

pantokenPreset(options?): TailwindPreset

實驗性

建置 pantoken 的 Tailwind 預設套件。

參數 ​

options? ​

PantokenPresetOptions = {}

PantokenPresetOptions.

回傳 ​

TailwindPreset

一個 Tailwind 預設套件,提供 colors、spacing 和 fontFamily。

範例 ​

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

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

export default {
  presets: [pantokenPreset()],
  content: ["./src/**/*.{ts,tsx}"],
};
// load the config with `@config` in your Tailwind v4 stylesheet, then use
// utilities like `bg-background-base p-space-md`

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

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

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