Skip to content

Commit 0840fe4

Browse files
committed
feat(tokens): 新增采集态顶栏高度 token
1 parent 5b881de commit 0840fe4

3 files changed

Lines changed: 22 additions & 0 deletions

File tree

‎app/scripts/gen-tokens.mjs‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,18 @@ export const SCALE_SOURCE = {
163163
* 与 §6.3「采集态 58px LIVE 仪表」**不同**:那是相变态的另一根高度,属批 6。
164164
*/
165165
navHeight: 56,
166+
/**
167+
* 采集态顶栏高度(规格 §6.3 逐字「采集态 **58px** LIVE 仪表」)—— 批 6 T17;裁决 R4.1。
168+
*
169+
* Why 与 `navHeight` **并列**而不是把 56 改成 58:`src/shell/navHeight.consumption.test.ts:130-146`
170+
* 把域内每个 `var(--ed-nav-h, <N>px)` 的兜底字面量**硬绑**本真源的 `navHeight` ⇒ 改 56 会让那条判据
171+
* **无处成立**(它的三条判据都靠「兜底 == 真源」这一个等式活着)。⇒ 采集态走**另一根**高度
172+
* `--ed-nav-h-live`,既有判据**零改动**(R4.1 逐字)。消费点(T18 的 `LiveBar`,58px 条)写
173+
* `var(--ed-nav-h-live, 58px)`:那三条正则(`FALLBACK_PX` / `FALLBACK_ANY` / `TOKEN_DECL`)都要求
174+
* `--ed-nav-h` 之后**紧跟逗号或冒号**,本 token 名中间夹着 `-live` ⇒ 对本 token 天然免疫(已逐字复核)。
175+
* ⚠️ 落点顺序:`tokens.css` 里 `--ed-nav-h` **必须排在** `--ed-nav-h-live` **之前**(`TOKEN_DECL` 取首个匹配)。
176+
*/
177+
navHeightLive: 58,
166178
};
167179

168180
const CSS_HEADER = `/*
@@ -216,6 +228,10 @@ ${SHADOW_TOKENS.map((t) => ` --ed-${t.name}: ${t.light}; /* ${t.usage} */`).joi
216228
/* 壳层纵向基准(规格 §1 决策 16):顶栏高度 —— 页面用 calc(100vh - var(--ed-nav-h)) 消费 */
217229
--ed-nav-h: ${SCALE_SOURCE.navHeight}px;
218230
231+
/* 相变态:采集态顶栏 58px(规格 §6.3 的 LIVE 仪表条)—— ⚠️ 必须排在 --ed-nav-h 之后
232+
(navHeight.consumption.test.ts 的 TOKEN_DECL 取首个匹配) */
233+
--ed-nav-h-live: ${SCALE_SOURCE.navHeightLive}px;
234+
219235
/* 动效:9 个时长(规格 §8.4,逐字迁自 primitives/motion.css 的临时接缝)+ 3 个缓动(全站唯一曲线 + 双基调两条) */
220236
${DURATION_TOKENS.map((t) => ` --ed-dur-${t.name}: ${t.ms}ms;`).join("\n")}
221237
${EASING_TOKENS.map((t) => ` --ed-${t.name}: ${t.value};`).join("\n")}
@@ -285,6 +301,7 @@ export const SCALE_TOKENS = {
285301
iconGrid: ${SCALE_SOURCE.iconGrid},
286302
iconStroke: ${SCALE_SOURCE.iconStroke},
287303
navHeight: ${SCALE_SOURCE.navHeight},
304+
navHeightLive: ${SCALE_SOURCE.navHeightLive},
288305
iconSizes: ${JSON.stringify(SCALE_SOURCE.iconSizes)},
289306
} as const;
290307

‎app/src/ui/tokens.css‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@
7373
/* 壳层纵向基准(规格 §1 决策 16):顶栏高度 —— 页面用 calc(100vh - var(--ed-nav-h)) 消费 */
7474
--ed-nav-h: 56px;
7575

76+
/* 相变态:采集态顶栏 58px(规格 §6.3 的 LIVE 仪表条)—— ⚠️ 必须排在 --ed-nav-h 之后
77+
(navHeight.consumption.test.ts 的 TOKEN_DECL 取首个匹配) */
78+
--ed-nav-h-live: 58px;
79+
7680
/* 动效:9 个时长(规格 §8.4,逐字迁自 primitives/motion.css 的临时接缝)+ 3 个缓动(全站唯一曲线 + 双基调两条) */
7781
--ed-dur-micro: 120ms;
7882
--ed-dur-overlay-in: 200ms;

‎app/src/ui/tokens.gen.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ export const SCALE_TOKENS = {
5454
iconGrid: 24,
5555
iconStroke: 1.75,
5656
navHeight: 56,
57+
navHeightLive: 58,
5758
iconSizes: [16,20,24],
5859
} as const;
5960

0 commit comments

Comments
 (0)