Skip to content

Potato Design System把语义放在颜色之前

框架无关的 Design Token。OKLCH 表达颜色,CSS Custom Properties 承载运行时,UnoCSS preset 连接应用。

分层 ​

text
Primitive Palette → Semantic Token → CSS Variables → UnoCSS preset → Application

Catppuccin 只提供 palette,Patina 负责品牌记忆。业务代码永远消费语义名:bg-primary、text-muted-foreground、border-border。

安装 ​

sh
pnpm add @potato-forge/ui
pnpm add -D unocss @iconify-json/tabler
ts
import { defineConfig, presetIcons, presetWind4 } from 'unocss'
import { presetPotato } from '@potato-forge/ui/preset'

export default defineConfig({
  presets: [presetWind4(), presetIcons(), presetPotato()],
})
html
<html data-theme="latte">
<body class="bg-background text-foreground">
  <button class="rounded-md bg-primary px-4 py-2 text-label font-semibold text-primary-foreground">
    保存
  </button>
</body>

当前范围 ​

packages/ui 是唯一 Token Source of Truth;本站负责解释与规范,Playground 负责呈现已确认的效果并承载待确认的临时实验。

正式组件库、React Adapter、Frappé / Mocha Theme Pack 不在当前范围——Catppuccin 只用 Latte 与 Macchiato 一对一映射亮暗两端。