DESIGN SYSTEM
暗夜与白昼两套主题的界面设计语言
单一琥珀强调、信息优先,
用于 AI 应用、开发工具与数据叙事页面。
An info-first interface language with Night and Day themes and a single amber accent.
原则 Principles · 概览 Overview · 目录 Contents · 使用 Usage · 结构 Structure
| 原则 Principle | 落成的规则 Rule |
|---|---|
| 信息优先 1. Information first |
每个视觉元素都编码信息,每个数字都有出处 Every mark encodes data, every number has a source |
| 紧凑 2. Compact |
4px 间距阶梯,同类元素同一尺寸 A 4px spacing scale and one size per element type |
| 平静 3. Calm |
界面强调色只有琥珀和冰蓝,不用投影 Amber and ice are the only UI accents, no shadows |
| 具触感 4. Tactile |
悬停位移只给精确指针,触控目标不小于 24px Hover lift for fine pointers only, targets of 24px or more |
| 可访问性良好 5. Accessible |
文字对比度 ≥4.5:1,axe-core 零违规 Text contrast of 4.5:1 or more, zero axe-core violations |
| 同一系列,不同版式 6. One family, many layouts |
token、字体和尺寸相同,骨架和首屏可以不同 Shared tokens, fonts and sizes with a free skeleton and hero |
| 可验证 7. Verifiable |
每条规则都有脚本检查,320–1440px 全宽度验收 Every rule is scripted and checked from 320 to 1440px |
| 中文排版优先 8. Chinese typography first |
中英文之间加空格,全角标点,不留单字孤行 Spaces between Chinese and Latin, full-width punctuation, no orphans |
| 原生实现优先 9. Native first |
图表用 HTML、CSS 和内联 SVG,不引入图表库 Charts in HTML, CSS and inline SVG, no chart libraries |
| README 原生可读 10. Native README |
只用 GitHub 能渲染的写法,不放图片,中英对照 GitHub-native markup, no images, bilingual |
| 动效说明变化 11. Motion explains change |
先退出、再移动、后进入,数字不从 0 数起,持续的动效可以暂停 Exit, move, then enter; no count-ups; lasting motion can be paused |
每条原则在 design-system/README.md 里展开为可检验的规则。
Each principle expands into checkable rules in the design system README.
Tight Surface 是一套跨产品的界面设计语言:同一套 token 和组件,可以搭出手册、地图、仪表盘和 Agent 应用等不同版式,但一眼就能认出是同一个系列。默认主题是暗夜(Night);在 <html> 上加 data-theme="day" 就切换到浅色的白昼(Day),组件和尺寸不变,只换颜色。
Tight Surface is a cross-product interface language. One set of tokens and components builds handbooks, maps, dashboards and agent apps that still read as one family. Night is the default theme; add data-theme="day" to <html> for the light Day theme, which changes colours only.
源码版本为 v2.8.0,正式发布以仓库的 v2.8.0 标签为准。变更见 CHANGELOG.md,严格门禁和消费方接入见表面契约与迁移说明。
The source version is v2.8.0. The repository tag v2.8.0 identifies the formal release. See CHANGELOG.md for changes and the surface contract and migration guide for the strict gate and consumer integration.
| 11 | 2 | 45 | 28 |
|---|---|---|---|
| 原则 Principles |
主题 Themes |
颜色 token Colour tokens |
组件 Components |
| 文档 Document | 内容 What it covers |
|---|---|
| README.md | 设计原则、文案、颜色、字体、间距、图标、组件选择 Principles, copy, colour, type, spacing, icons, component choice |
| day-theme.md | 白昼主题的取值规则与对比度 Day theme values and contrast |
| interaction.md | 聚焦高亮、指针类型与固定按钮 Focus highlight, pointer types and pin toggles |
| motion.md | 动效参数、八条规则、标准模式与反例 Motion tokens, eight rules, standard patterns and counterexamples |
| charts.md · data-viz.md | 原生图表与数据可视化 Native charts and data visualization |
| qa.md | 交付验收清单,共七组 The delivery checklist in seven groups |
| github-readme.md | README 规范与检查 README rules and checks |
| kumo.md | Kumo 适配,对照页含 25 个组件 Kumo adapter with 25 components in its demo |
| icons | Lucide 图标 sprite 与许可声明 The Lucide icon sprite and its license |
| components | 28 个组件的说明与预览 Notes and previews for 28 components |
| SKILL.md | 同一套规则的 Claude 技能版本 The same rules as a Claude skill |
在页面里依次引入 tokens.css 和 components/bundle.css 两个文件,组件的类名和写法见各组件的说明。用 React 写表单、浮层这类应用控件时,按 kumo.md 接入 Kumo 和适配层。图标统一用 Lucide 1.71.0:静态页面从 icons/sprite.svg 复制需要的图标,React 项目用 lucide-react,写法见 Icon 组件的说明。
Load tokens.css first, then components/bundle.css; class names and markup are in each component's notes. For app controls such as forms and overlays in React, add Kumo and the adapter as described in kumo.md. Icons are Lucide 1.71.0: static pages copy what they need from icons/sprite.svg, React projects use lucide-react, as the Icon notes describe.
<!-- Night 是默认主题;加 data-theme="day" 切换到 Day -->
<html lang="zh-CN" data-theme="day">
<link rel="stylesheet" href="tight-surface/tokens.css">
<link rel="stylesheet" href="tight-surface/components/bundle.css">按验收清单运行页面检查,通过后再交付。严格模式按共享契约核验相邻表面间距。
Follow the QA checklist and run the page check before delivery. Resolve every failure before delivering. Strict mode checks adjacent surface gaps against the shared contract.
python3 -m pip install -r tools/surface/requirements.txt
python3 -m playwright install chromium
python3 tools/page_check.py path/to/index.html
python3 tools/page_check.py path/to/index.html --strict-surface --surface-root maindesign-system/ 设计系统本体,与 artifact 的 project/ 一一对应 · The design system, mirroring the artifact
README.md 设计原则与视觉基础 · Principles and foundations
tokens.json / .css 两套主题的 token · Tokens for both themes
components/ bundle.css 与 28 个组件 · bundle.css and 28 components
kumo/ Kumo 适配层与对照页 · Kumo adapter and demo
icons/ Lucide 图标 sprite 与许可 · Lucide sprite and license
*.md 白昼主题、交互、动效、图表、验收、README 规则 · Day, interaction, motion, charts, QA, README rules
skill/SKILL.md tight-surface-ui 技能 · The Claude skill
tools/ 组件、页面、类名和 README 检查,文件清单 · Component, page, class-name and README checks, manifest
surface/ 相邻表面规则的唯一实现与共享契约 · The surface engine and its shared contract
docs/maintaining.md 版本与同步流程 · Release and sync steps
CHANGELOG.md 版本记录 · Release notes
| 页面 Page | 版式 Layout | 仓库 Repository |
|---|---|---|
| 大模型可视化学习指南 LLM Visual Guide |
手册版式,左侧目录 Handbook layout with a side TOC |
llm-visual-guide |
| 斯坦福 AI 课程地图 Stanford AI Course Map |
地图版式,顶部导航 Map layout with a top nav |
stanford-ai-courses |
| 大模型 Attention 架构与技术路线对照 Attention Architectures |
白昼主题,顶部导航 Day theme with a top nav |
attention-architectures |
代码、样式表、token 和脚本采用 MIT 许可;README、设计说明等原创文档采用 CC BY 4.0 许可。图标来自 Lucide,采用 ISC 许可,声明见 LICENSE-lucide.txt。
Code, stylesheets, tokens and scripts are under the MIT license; original documentation such as this README and the design notes is under CC BY 4.0. Icons come from Lucide under the ISC license; see the Lucide notice in the icons folder.