Skip to content

Commit 71ca860

Browse files
committed
feat(ui): add nav height design token
1 parent 85d51d8 commit 71ca860

3 files changed

Lines changed: 18 additions & 0 deletions

File tree

‎app/scripts/gen-tokens.mjs‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,16 @@ export const SCALE_SOURCE = {
9898
iconGrid: 24,
9999
iconStroke: 1.75,
100100
iconSizes: [16, 20, 24],
101+
/**
102+
* 顶栏高度(规格 §1 决策 16「`--nav-h` 变量」)。
103+
*
104+
* Why 进 SCALE_SOURCE 而不是留在调用点:它是**壳层与 9 个页面共用的纵向基准**
105+
* (8 个页面的 `calc(100vh - 56px)` + `AiConversationDock` 的 `top: 56` + 顶栏自身 `height`),
106+
* 散落时改一次高度要同步 10 处,且没有任何门禁看得见漏改的那一处。
107+
* 值 56 是**实测的既有值**(v0.18.0 起 8 Tab 就是 56,见 App.tsx 顶栏样式),本批不改高度、只把它变成变量。
108+
* 与 §6.3「采集态 58px LIVE 仪表」**不同**:那是相变态的另一根高度,属批 6。
109+
*/
110+
navHeight: 56,
101111
};
102112

103113
const CSS_HEADER = `/*
@@ -148,6 +158,9 @@ ${SHADOW_TOKENS.map((t) => ` --ed-${t.name}: ${t.light}; /* ${t.usage} */`).joi
148158
/* 遮罩 */
149159
--ed-overlay-alpha: ${SCALE_SOURCE.overlayAlpha};
150160
161+
/* 壳层纵向基准(规格 §1 决策 16):顶栏高度 —— 页面用 calc(100vh - var(--ed-nav-h)) 消费 */
162+
--ed-nav-h: ${SCALE_SOURCE.navHeight}px;
163+
151164
/* 图标 */
152165
--ed-icon-stroke: ${SCALE_SOURCE.iconStroke};
153166
}
@@ -197,6 +210,7 @@ export const SCALE_TOKENS = {
197210
overlayAlpha: ${SCALE_SOURCE.overlayAlpha},
198211
iconGrid: ${SCALE_SOURCE.iconGrid},
199212
iconStroke: ${SCALE_SOURCE.iconStroke},
213+
navHeight: ${SCALE_SOURCE.navHeight},
200214
iconSizes: ${JSON.stringify(SCALE_SOURCE.iconSizes)},
201215
} as const;
202216

‎app/src/ui/tokens.css‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,9 @@
6969
/* 遮罩 */
7070
--ed-overlay-alpha: 0.34;
7171

72+
/* 壳层纵向基准(规格 §1 决策 16):顶栏高度 —— 页面用 calc(100vh - var(--ed-nav-h)) 消费 */
73+
--ed-nav-h: 56px;
74+
7275
/* 图标 */
7376
--ed-icon-stroke: 1.75;
7477
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ export const SCALE_TOKENS = {
5353
overlayAlpha: 0.34,
5454
iconGrid: 24,
5555
iconStroke: 1.75,
56+
navHeight: 56,
5657
iconSizes: [16,20,24],
5758
} as const;
5859

0 commit comments

Comments
 (0)