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- 前缀下公开原始调色板

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

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