diff --git a/apps/tutorial/src/components/ChapterPage.tsx b/apps/tutorial/src/components/ChapterPage.tsx index 61760de..69308fe 100644 --- a/apps/tutorial/src/components/ChapterPage.tsx +++ b/apps/tutorial/src/components/ChapterPage.tsx @@ -23,15 +23,18 @@ export function ChapterPage({ id }: { id: ChapterId }) { {/* 章头:与书架相框共享 view-transition-name —— 点卡片进来时相框飞进来变成章头 */}
+ + 0{id} + {ch.emoji}
-

+

第 {id} 章 · {ch.title}

-
+
▲ 目标:{ch.target.goal} ○ 预期:{ch.target.expectation} @@ -52,18 +55,20 @@ export function ChapterPage({ id }: { id: ChapterId }) { {i + 1} {s.kind === 'value' ? ( - {s.title} + {s.title} ) : ( - + {s.title} 代理区 · 交给 agent )}
-

{s.what}

-

- 验收:{s.accept} +

{s.what}

+

+ 验收 + · + {s.accept}

))} @@ -76,9 +81,9 @@ export function ChapterPage({ id }: { id: ChapterId }) {
- {b.name} + {b.name}
-

+

是什么:{b.what}
为何在这:{b.why} @@ -94,7 +99,7 @@ export function ChapterPage({ id }: { id: ChapterId }) {

-

{c.base}

+

{c.base}

)} diff --git a/apps/tutorial/src/lib/ui.tsx b/apps/tutorial/src/lib/ui.tsx index f3595ed..a6a5b22 100644 --- a/apps/tutorial/src/lib/ui.tsx +++ b/apps/tutorial/src/lib/ui.tsx @@ -1,4 +1,5 @@ -/** 教程站页面骨架:站头导航跨页常驻(view-transition-name 共享元素,页间不闪烁) */ +/** 教程站页面骨架:站头导航跨页常驻(view-transition-name 共享元素,页间不闪烁)。 + * 选中项背景色=该章色(与章头 title 横幅统一);书架选中为 ink。 */ import type { ReactNode } from 'react' import type { ChapterId } from './types' import { CHAPTERS } from './chapters' @@ -22,39 +23,43 @@ export function Page({ /** 章节页标题在章头横幅里,可省 */ title?: string desc?: string - /** 站头高亮的章节;书架页不传 */ - active?: ChapterId + /** 站头高亮:章节 id 或书架 'index' */ + active?: ChapterId | 'index' children: ReactNode }) { return ( -
+
stack·教程 - {NAV.map((n) => ( - - {n.label} - - ))} + {NAV.map((n) => { + const on = n.id ? n.id === active : active === 'index' + return ( + + {n.label} + + ) + })}
{(title || desc) && ( -
- {title &&

{title}

} - {desc &&

{desc}

} +
+ {title &&

{title}

} + {desc &&

{desc}

}
)} {children} -
+
stack·教程 · 孟菲斯 × 拟物卡 · 靶子先行,步骤=目标+验收
@@ -64,9 +69,9 @@ export function Page({ export function Section({ label, note, children }: { label: string; note?: string; children: ReactNode }) { return (
-

- {label} - {note && {note}} +

+ {label} + {note && {note}}

{children}
diff --git a/apps/tutorial/src/pages/index/App.tsx b/apps/tutorial/src/pages/index/App.tsx index 99c30d5..283584b 100644 --- a/apps/tutorial/src/pages/index/App.tsx +++ b/apps/tutorial/src/pages/index/App.tsx @@ -26,6 +26,7 @@ const GRID: { id: ChapterId; entry?: 1 | 2 | 3 }[] = [ export function App() { return ( diff --git a/apps/tutorial/src/styles/tokens.css b/apps/tutorial/src/styles/tokens.css index a506c9f..a4f88ae 100644 --- a/apps/tutorial/src/styles/tokens.css +++ b/apps/tutorial/src/styles/tokens.css @@ -82,3 +82,40 @@ animation-duration: 0.01ms; } } + +/* ===== 字体系统 ===== + * 基准=浏览器默认 16px=正文字号(content,不另设基准)。 + * 向上:t3 → t2 → t1 三级标题;再向上是大字。 + * 小字两态:t-small-mute 边缘可忽略(弱化灰)/ t-small-strong 缩小但加强(加粗收字距)。 + * 大字两态:t1 大而强(页面主标题)/ t-display 大而弱(幽灵背景字,可被忽略)。 */ +@theme { + --text-content: 1rem; + --text-content--line-height: 1.75; + --text-t3: 1.125rem; + --text-t3--line-height: 1.5; + --text-t2: 1.375rem; + --text-t2--line-height: 1.45; + --text-t1: 1.75rem; + --text-t1--line-height: 1.3; + --text-small: 0.75rem; + --text-small--line-height: 1.65; +} + +.t-small-mute { + font-size: var(--text-small); + line-height: var(--text-small--line-height); + color: var(--color-mute); +} +.t-small-strong { + font-size: var(--text-small); + line-height: 1.5; + font-weight: 700; + letter-spacing: 0.02em; + color: var(--color-ink); +} +.t-display { + font-size: 4rem; + line-height: 1; + font-weight: 800; + color: color-mix(in srgb, var(--color-ink) 10%, transparent); +}