系统如何运作
每一种风格都是一个 复合设计变量:一类,例如 text-body-medium 将字体大小、行高、字母间距和粗细设置在一起,定义在 styles/typography.css。你们永远不会结合 text-sm 与 font-medium 和 leading-5 手动 - 单个令牌保证 Figma 文本样式指定的精确指标。
命名是 text-{family}-{weight} - 13 个系列 × 4 个粗细(常规 400、中号 500、半粗体 600、粗体 700)。颜色与语义文本变量分开应用,因此典型的标签为 text-body-medium text-text-secondary:一类用于指标,一类用于颜色。
因为这些班级住在 text-* 命名空间,它们注册到 cx() (我们的顺风合并包装器)作为字体大小实用程序 - 否则与颜色类的合并会默默地删除它们。如果您添加或重命名样式,请将其镜像到 utils/cx.ts.
大标题
64px / 80pxHero numerals and marketing-scale headings.
显示1
56px / 72pxFull-page hero headings.
显示2
48px / 64pxLarge section heroes.
显示3
40px / 54pxProminent stats and page heroes.
显示4
32px / 44pxPage titles; the largest style used inside the app shell.
标题 1
24px / 34pxCard headline figures (step totals, earnings).
标题 2
20px / 26pxSection headings inside pages and panels.
标题 3
18px / 24–26pxSub-section headings, calendar month titles.
标题
16px / 22pxEmphasized body copy and lead paragraphs.
身体
14px / 20pxThe default UI text: labels, table cells, nav items.
身体2
13px / 18pxDense contexts: compact tables, secondary descriptions.
说明文字 1
12px / 16px · tracking 0.15pxAxis labels, unit suffixes, timestamps.
说明文字2
11px / 15px · tracking 0.2pxThe smallest legible annotations (badges, fine print).