Skip to content

01. 色彩系统 (Colors) ​

基于 HSL 值的 CSS 变量系统。

基础色板 ​

Token描述用途
background页面背景body, dialog background
foreground页面文字body text
card卡片背景Card, Popover
primary主色调主要按钮, 激活状态
secondary次色调次要按钮, 标签
muted柔和色辅助文字, 禁用状态
accent强调色悬停效果, 选中项
destructive破坏色删除, 错误提示

使用示例 ​

tsx
// ✅ 正确:语义化
<div className="bg-background text-foreground">
  <button className="bg-primary text-primary-foreground">Action</button>
  <span className="text-muted-foreground">Subtitle</span>
</div>

// ❌ 错误:硬编码
<div className="bg-white text-black">
  <button className="bg-blue-500 text-white">Action</button>
</div>

Released under the MIT License.