做产品 PMaker
空格的键盘
tokens.css
/* 颜色 */
--color-primary: #2f6df6; --color-ink: #16151a; --color-mid: #5c5a66;
--color-faint: #9d9aa5; --color-line: #e8e7ec; --color-bg: #fafafb;
--color-success / warning / danger
/* 间距 */
--sp-1: 4px; --sp-2: 8px; --sp-3: 16px; --sp-4: 24px; --sp-5: 40px; --sp-6: 64px;
/* 字号 */
--fs-title: 28px; --fs-h: 16px; --fs-body: 14px; --fs-cap: 12px;
/* 圆角与阴影 */
--r-sm: 4px; --r-md: 8px; --r-lg: 12px; --shadow-1 / --shadow-2

四组变量,二十来行。一个人做产品,这就是全部的设计系统。

Build a Minimal Design System

Four sets of variables, twenty-odd lines of code, and the whole project's styling converges. It's the highest-ROI one-time action you can take.

What you will run into
  • 想统一调整主题色,发现十几个文件里都写死了色号
  • 每个页面的圆角、阴影、灰度都不太一样
  • 让 AI 做新页面,它的配色跟前面几页对不上

Hearing "design system" you picture a spec document of hundreds of pages — that's a product of large-team collaboration. What a solo builder needs is just one layer: collect the values scattered everywhere into a set of named variables. Every later component and page references these names, and styling stays consistent on its own.

Four Sets of Variables

组包含什么数量建议
颜色 主题色、灰阶、语义色 主题色 1 个(可拉 3 档深浅)、灰阶 6 档、语义色 3 个
间距 4 的倍数序列 6 个:4 / 8 / 16 / 24 / 40 / 64
字号 字号加配套行高 4 个:大标题 / 小标题 / 正文 / 辅助
圆角与阴影 圆角档位、阴影层级 圆角 3 档、阴影 2 档。多了会显得杂
Radius and shadow are the easiest to overlook, but they're a big part of why something "looks like a product." An interface with four corner radii — 4px, 6px, 8px, 12px — won't be easy to name, but it'll feel unrefined.

Put them in one file, using CSS variables or your framework's token mechanism. The technique doesn't matter — what matters is that everything afterwards references the variable name, with no literal values anywhere.

设计系统需要的只有一层:把散在各处的数值收成一组有名字的变量 写死在十几个文件里 #3b82f6 #2f6df6 13px 14px 11px 15px 6px 12px 想统一换个主题色,得翻遍代码 四组有名字的变量 颜色 主题色 1 · 灰阶 6 · 语义色 3 间距 4 / 8 / 16 / 24 / 40 / 64 字号 大标题 / 小标题 / 正文 / 辅助,各配行高 圆角与阴影 圆角 3 档 · 阴影 2 档 组件和页面只引用变量名,改一处全站生效 最容易被忽略的是圆角——一眼说不出问题,但会觉得不精致 同一个界面里出现四种圆角 它们是「像不像一个产品」的重要来源
Radius and shadow are the easiest to overlook, but they're a big part of why something "looks like a product." An interface with four corner radii — 4px, 6px, 8px, 12px — won't be easy to name, but it'll feel unrefined.

When to Let It Grow

Note for the AI

CLAUDE.md · Design tokens
## 设计令牌

全部样式变量定义在 src/styles/tokens.css,共四组:
颜色、间距、字号、圆角与阴影。

强制要求:
- 任何组件和页面里都不允许出现具体的颜色值、
  间距数值、字号、圆角值。一律引用变量。
- 需要一个令牌里没有的值时,先说明用途和建议值,
  等我确认后加进 tokens.css,不要就地写死。
- 新增令牌时保持命名风格一致,并说明它跟已有令牌的关系。

生成任何界面代码之前,先读一遍 tokens.css。
生成之后,检查有没有硬编码的数值并报告。

That last line stops most style drift. The AI happily writes a literal `#3b82f6` while coding; an active check costs very little.