docs(grammar): 落 ADR-0008 并改掉说谎的那一方,含四条经验教训与台账 §11
对标实测证伪了 ADR-0004 的两条视觉判据,所以本笔的主体是**改文档**:
判据错在文档里,而不是错在代码里,不一起改就是文档变成说谎的那一方。
新增 `docs/adr/0008-benchmark-grammar-takeover.md`(取证方法、实测对照表、
四项裁定、已知偏差 6 条、验证契约):
- Bain 走 archive.org 快照 2026-08-31(1600×846)绕开 Cloudflare,
Porsche 取 live 国际站 + 中国站导航,逐元素 `getComputedStyle`。
- **被证伪 ①**(决策四)「关键数字 = 超大字号 + 品牌色」:
Bain 成果数字实测 **40px / 字重 500 / 纯黑**;
本仓 `--font-size-5xl: 2.25rem` 在桌面根字号 18px 下 = 40.5px ⇒ 现档正好命中,零新增令牌。
- **被证伪 ②**(决策一)「4px 色条为辅」:两家**都不用颜色给内容分类**,
饱和红用作"面"的次数为 **0**(Bain #CC0000 出现 65 次全是字与线,
Porsche 红出现 4 次全是按钮)。
ADR-0004 决策一、决策四两处就地加 ⚠️ 修订块并指向 ADR-0008。
ADR 不重写历史,但必须让读者不会把已废判据当现状。
`DESIGN.md`:front-matter 的 `rounded:` 改成 0–4px 记档 + 新增 `cta: "0px"`;
`components.cta-*/badge-pill/card-bain/input-field` 的 `rounded` 从
`{rounded.full}` 改 `{rounded.cta}` 或 `{rounded.md}`,
padding 按实测 `14px 28px`;Elevation 段删掉「hover 升至 card-shadow-hover + translateY(-4px)」;
数据条段把「font-black + 品牌红」改为「text-5xl / 500 / text-ink」并注明是被实测推翻的那条;
Navigation 段写入双轴与「真源是代码、CMS 行须满足 IA 契约才采纳」。
`CONTEXT.md` 关键决策表 +9 行:对标双轴导航 / 导航真源=代码 / 视觉语法记档 /
僵尸令牌 / 彩色编码适用面 / 成果槽 ResultsSlot / 替代信号槽 / 承诺单一真源 /
「注释写在 JSX children 位 = 页面文字」。
`docs/development/quality-gates.md`:
- §1 的 lint warning **权威计数就地更新**:本树 `EXIT=0 / 0 error / 81 warning`,
分项相加必须等于总数(55+12+8+4+1+1 = 81 ✓),
并给出与 2026-09-23 那 104 条的逐项对账(`no-explicit-any` 25→4 等,净 −23 ✓)。
归因**已实证到文件**而不是只看方向一致:逐个 `git show da9a5cb6:<被删文件>` 数出
33 处 `any` 命中(v15.test 12 / NewsDetailClient.test 8 / v15 4 / …),
并说明命中数 ≠ 告警数的差额来源,附可复算命令。
- §5.1 `check:motion` 现状 23 处 → **8 处 / 4 文件**,
并写明残留 8 处全部经 `git show` 自证为基线 `da9a5cb6` 既有红、非本轮引入。
- 新增 §5.2 记录 `check:visual`(R1–R11 每条的分母口径与两条闸的**适用边界**),
§7 的 `test:all` 组成改为八段并注明自证先跑。
- 另记一条:这条计数一度被读成 0 error,是因为管道吞掉了 EXIT=1(见 §5.38)。
`docs/lessons-learned.md` 四条(§5.38–§5.41)+ 更新记录 4 行:
管道吞退出码复犯 / 合法 JSX 的注释渲染成页面文字而三道门禁全绿 /
仪器只在被复用时才坏(module 层累加器 + 互斥前提塞进同一份夹具)/
僵尸令牌(删了值没删引用,R5 与 R7 各看一侧所以两条都绿)。
`docs/acceptance/qa-tracker.md` §11:四台仪器表(每台的可失败证据)、
本轮 5 条缺陷与根因、6 个 spec 的重锚对照表、
新登记 4 条待拍(DEC-N1 彩色编码第二通道 / N2 stagger 默认值 /
N3 motion 残留 8 处 / N4 既有案例区无门槛)+ 2 条待授权(AUTH-VISUAL / AUTH-NAV)。
`config/test/lighthouserc.json`:URL 集补 `/insights`(新的一级轴)与
`/solutions/manufacturing`(本批 tracer-bullet 承载页)——
不补就是新页没有任何 Lighthouse 覆盖。
`README.md`:加本批进度条目,并把「check:motion 仍 23 处」的旧数改为指向
quality-gates §5.1 的现取口径。
探针 7 份入库 `docs/acceptance/2026-10-17-ia-e2e/`(导航结构 / 面板链接 /
首页 testid 与文案 / 段序文档坐标 / 页脚入口),是本批所有 E2E 断言的取证来源。
本笔纯文档 + 配置,不改运行时代码;同树已跑过的验证仍成立:
`npm run test:all` EXIT=0、`type-check` EXIT=0、`lint` EXIT=0(0/81)、
`test:unit` 141 套件 / 1747 例、`check:visual` 11/11 + accents 成立、`build` EXIT=0。
This commit is contained in:
1 parent
ec543ff242
commit
f23500ff07
18 files changed
+522
-29
No files matched your search
@@ -54,12 +54,14 @@ typography:
|
||||
fontWeight: 400
|
||||
letterSpacing: "0.2em"
|
||||
rounded:
|
||||
xs: "3px"
|
||||
sm: "6px"
|
||||
md: "8px"
|
||||
lg: "12px"
|
||||
xl: "18px"
|
||||
2xl: "24px"
|
||||
xs: "0px"
|
||||
sm: "0px"
|
||||
md: "2px"
|
||||
lg: "2px"
|
||||
xl: "4px"
|
||||
2xl: "4px"
|
||||
3xl: "4px"
|
||||
cta: "0px"
|
||||
full: "9999px"
|
||||
spacing:
|
||||
xs: "4px"
|
||||
@@ -75,22 +77,25 @@ spacing:
|
||||
components:
|
||||
cta-primary:
|
||||
backgroundColor: "{colors.cinnabar}"
|
||||
textColor: "{colors.paper}"
|
||||
rounded: "{rounded.full}"
|
||||
padding: "16px 40px"
|
||||
textColor: "#FFFFFF"
|
||||
rounded: "{rounded.cta}"
|
||||
padding: "14px 28px"
|
||||
cta-primary-hover:
|
||||
backgroundColor: "{colors.cinnabar-deep}"
|
||||
cta-secondary:
|
||||
backgroundColor: "{colors.paper}"
|
||||
textColor: "{colors.ink}"
|
||||
rounded: "{rounded.full}"
|
||||
padding: "16px 40px"
|
||||
border: "1px {colors.border-rule}"
|
||||
rounded: "{rounded.cta}"
|
||||
padding: "14px 28px"
|
||||
cta-dark:
|
||||
textColor: "#F8FAFC"
|
||||
rounded: "{rounded.full}"
|
||||
padding: "16px 40px"
|
||||
rounded: "{rounded.cta}"
|
||||
padding: "14px 28px"
|
||||
card-bain:
|
||||
backgroundColor: "{colors.paper}"
|
||||
rounded: "{rounded.lg}"
|
||||
rounded: "{rounded.md}"
|
||||
border: "1px hairline → hover {colors.border-rule}(不抬升、不加阴影)"
|
||||
padding: "24px"
|
||||
input-field:
|
||||
backgroundColor: "{colors.paper}"
|
||||
@@ -99,7 +104,7 @@ components:
|
||||
badge-pill:
|
||||
backgroundColor: "{colors.cinnabar-blush}"
|
||||
textColor: "{colors.cinnabar}"
|
||||
rounded: "{rounded.full}"
|
||||
rounded: "{rounded.cta}"
|
||||
---
|
||||
|
||||
# Design System: Novalon Website
|
||||
@@ -188,7 +193,12 @@ Novalon 的界面是一份可以逐条审计的经营宣言。它模仿顶级咨
|
||||
|
||||
## Elevation & Depth
|
||||
|
||||
分层靠「几乎看不见的边框 + 真实柔和的阴影」完成:`--color-border-primary` 被刻意软化到 #EEF2F7,卡片默认 `--shadow-sm`/card-shadow 贴地,hover 升至 `--card-shadow-hover` 并 translateY(-4px)。阴影全部从墨色 rgba(10,14,20,α) 取用,不用纯黑。
|
||||
分层靠「几乎看不见的边框 + 真实柔和的阴影」完成:`--color-border-primary` 被刻意软化,卡片默认 `--shadow-sm`/card-shadow 贴地。
|
||||
**hover 不再抬升**(2026-10-17 起,见 [ADR-0008](docs/adr/0008-benchmark-grammar-takeover.md)):
|
||||
`--card-shadow-hover` 已退役,`.bain-card:hover` 只做「边框转 `border-rule` + 底色转 `bg-secondary`」,
|
||||
`translateY(-4px)` 一并删除 —— 对标实测两家 hover 只改 hairline,没有位移与阴影增长。
|
||||
存量 `hover:-translate-y` 28 处 / 19 文件由 `check:grammar` 的 R10 递减棘轮登记,只降不升。
|
||||
阴影全部从**暖墨色** rgba(20,18,16,α) 取用(原 rgba(10,14,20,α) 冷 slate 与暖纸底不同族,16 处已统一),不用纯黑。
|
||||
|
||||
### Shadow Vocabulary
|
||||
- **xs–xl 层级带** (`0 1px 1px α0.03` → `0 24px 56px α0.1`): 微边界 → 卡片 → 下拉 → 模态 → 全屏浮层。
|
||||
@@ -200,29 +210,69 @@ Novalon 的界面是一份可以逐条审计的经营宣言。它模仿顶级咨
|
||||
|
||||
## Shapes
|
||||
|
||||
柔边体系:徽章/焦点元素 3px、按钮/输入 6px、卡片/弹窗 8px、大卡 12px(`--card-border-radius`)、英雄卡 18px、全屏弹窗 24px;CTA 与 badge 一律全圆角 pill。特色几何:区块顶/底 0.5–2px 朱砂条带、`corner-frame` L 形角框(16px 红色直角)、`clip-slant` 斜切(Accenture 遗产,仅装饰带使用)。卡片在 1px 淡边框与阴影之间只声明一次 elevation(边框为 hairline 级)。
|
||||
**直角体系(2026-10-17 起,见 [ADR-0008](docs/adr/0008-benchmark-grammar-takeover.md))**:
|
||||
`--radius-xs/sm = 0px`、`--radius-md/lg = 2px`(卡片)、`--radius-xl/2xl/3xl = 4px`、
|
||||
`--radius-cta = 0px`(CTA 与 badge 专用)。**CTA 不再是 pill** —— 对标实测
|
||||
Bain 与 Porsche Consulting 抽样元素 `border-radius` 全部为 0,`rounded-full` 是本仓自造语法。
|
||||
|
||||
⚠ **`--radius-full` 保持 9999px,不可归零**:它承载的是**功能性的圆**
|
||||
(`avatar` `switch` `slider` `radio-group` `progress` `scroll-area` 骨架屏 pulse 点)。
|
||||
把它一并归零会把后台与所有 Radix 表面的旋钮、滑块、头像全部方角化。
|
||||
由 `check:grammar` 的 R2 正向守卫 + R9 双向判据守住这条线。
|
||||
装饰性圆形(如套件组合图的中心节点)改用 `rounded-cta` 方角牌。
|
||||
|
||||
特色几何:区块顶/底 0.5–2px 朱砂条带、`corner-frame` L 形角框(16px 红色直角)、
|
||||
`clip-slant` 斜切(Accenture 遗产,仅装饰带使用)。卡片在 1px 淡边框与阴影之间只声明一次
|
||||
elevation(边框为 hairline 级)。
|
||||
|
||||
## Components
|
||||
|
||||
### Buttons(CTAButton,全站行动召唤)
|
||||
- **Shape:** 全圆角 pill(rounded-full),内置 ArrowRight 箭头签名,hover 位移 translate-x。
|
||||
- **Primary:** 朱砂填充 + 白字(16px 40px),hover 转 Cinnabar Deep;**Secondary:** 墨色 20% 描边透明底;**Dark:** 深色区块专用浅描边;**Inline:** 透明小箭头文字链,用于卡内「了解更多」。
|
||||
- 交互 Button(ui/button.tsx)另带 6 档 size 与 ripple,触控下限 44×44px。
|
||||
- **Shape:** `rounded-cta`(0px,两轨一致);四档共用 `px-7 py-3.5 text-sm font-medium`。
|
||||
**箭头只在 `inline` 轨**,实心/描边轨不内置 ArrowRight —— 对标实测两家按钮无图标签名。
|
||||
- **Primary:** 朱砂填充 + 白字,hover 转 `bg-brand-hover`;
|
||||
**Secondary:** 静止边框 `border-border-rule`(#8A8377,对卡底实测 3.75:1,不是 `ink/20`),
|
||||
hover 转 `border-border-dark`;**Dark:** 深色区块专用浅描边;**Inline:** 透明小箭头文字链。
|
||||
- 过渡统一 `transition-colors duration-hover`(150ms)—— 只有颜色变化,
|
||||
因此不写 `transition-all`(那会把阴影/位移一起接进来)。
|
||||
- 交互 Button(`ui/button.tsx`)另带 6 档 size 与 ripple;其**文字档改直角、
|
||||
`icon` 档保持 `rounded-full`**(圆形图标钮是功能形状,由 R9 双向判据保护)。
|
||||
|
||||
### Cards / Containers(bain-card)
|
||||
- **Corner Style:** 12px 柔边;**Background:** Paper;**Border:** 1px hairline;**Shadow:** card-shadow → hover 抬升 4px + card-shadow-hover;内边距 24px(大 40px)。
|
||||
- **Corner Style:** 2px(`--radius-md`);**Background:** Paper;**Border:** 1px hairline;
|
||||
**hover:** 边框转 `border-rule` + 底色转 `bg-secondary`,
|
||||
**不抬升、不加阴影**(对标实测两家 hover 只改 hairline;
|
||||
`--card-shadow-hover` / `--shadow-brand*` 已退役)。内边距 24px(大 40px)。
|
||||
|
||||
### Inputs / Fields
|
||||
- Paper 底、hairline 描边、6px 圆角、44px 高;focus 转 `border-brand/50`;标签常驻(placeholder 仅作示例);错误文案内联于字段下。
|
||||
- Paper 底、hairline 描边、直角、44px 高;focus 转 `border-brand/50`;标签常驻
|
||||
(placeholder 仅作示例);错误文案内联于字段下。
|
||||
|
||||
### Navigation
|
||||
- 白色 sticky 头部,active 项朱砂下划线;桌面 hover 展开 mega dropdown(分组 + 描述 + 状态 badge);移动端汉堡 + 底部 tab bar 双轨(在办:收敛为一套);skip-link 常驻。
|
||||
- 白色 sticky 头部,active 项朱砂下划线;桌面 hover 展开 mega dropdown(分组 + 描述 + 状态 badge);
|
||||
移动端汉堡 + 底部 tab bar 双轨;skip-link 常驻。
|
||||
- **一级导航是「行业 × 能力 + 洞察」双轴**(ADR-0008 决策二):
|
||||
`行业` → `/solutions`、`能力` → `/services`、`洞察` → `/insights`(新),
|
||||
`产品` **退出一级**,其入口降为能力 mega 内第二层的 `all-products → /products`。
|
||||
- **真源是代码常量** `NAVIGATION_V2` / `MEGA_DROPDOWN_DATA`;CMS `navigation` 行只在满足
|
||||
IA 契约(三个必需 mega key 齐备)时才覆盖代码,否则 fail closed 回代码
|
||||
(`src/lib/navigation-resolution.ts`)。反转的动机:实测复现出「一条自洽的旧行」
|
||||
会让页脚各列静默变空。
|
||||
|
||||
### 数据条(Stats Strip)
|
||||
- 3 项为宜:数字用 display 级 font-black + `tabular-nums` + 品牌红,label 用小灰字。这是「答案先行」的结构件,但仅在数据不被本页其它区域重复时放置(首页成果带、信任页 Hero);hub 页 Hero 的数据条因与下方网格逐字重复已移除。
|
||||
- 3 项为宜:数字用 **`text-5xl` / 字重 500 / `text-ink`(纯黑)** + `tabular-nums`,label 用小灰字。
|
||||
⚠ 原写「font-black + 品牌红」已被实测推翻:Bain 成果数字是 **40px / 500 / 纯黑**,
|
||||
且两家饱和红**从不用作面**(`text-5xl` = `2.25rem` 在桌面根字号 18px 下正好 40.5px,零新增令牌)。
|
||||
这是「答案先行」的结构件,但仅在数据不被本页其它区域重复时放置(首页成果带、信任页 Hero);
|
||||
hub 页 Hero 的数据条因与下方网格逐字重复已移除。
|
||||
- 每个数字必须带 `basis`(`target | team-history | verified`),量化项与定性项分列,
|
||||
不拿定性句冒充数字。
|
||||
|
||||
### Badge / 状态签
|
||||
- Pill,12% 软底或 blush 底 + 品牌/编码色文字 + 20% 同色描边;「内测中 / 敬请期待」等诚实状态以此呈现。
|
||||
- **直角**(`--badge-radius: var(--radius-cta)`),12% 软底或 blush 底 + 品牌/编码色文字 + 20% 同色描边;
|
||||
「内测中 / 敬请期待」等诚实状态以此呈现。
|
||||
- ⚠ **状态签不再用 coding accent 上色**:`accent-*` 只可被图表/序列组件与后台工具 UI 的分类色标消费,
|
||||
营销面出现即由 `npm run check:accents` 判红(ADR-0008 决策一修订)。
|
||||
|
||||
## Do's and Don'ts
|
||||
|
||||
|
||||
Reference in new issue
Block a user