From a65a6d96b1a6128ccf1dd3495e48b849ba0f2f73 Mon Sep 17 00:00:00 2001 From: cqh963852 Date: Thu, 8 Oct 2026 12:08:33 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=B8=83=E5=B1=80=E4=B8=89=E4=BF=AE?= =?UTF-8?q?=E2=80=94=E2=80=94navbar=20=E4=B8=8B=E6=96=B9=E7=BB=9F=E4=B8=80?= =?UTF-8?q?=2032px=20=E9=97=B4=E8=B7=9D=EF=BC=88=E7=AB=A0=E8=8A=82?= =?UTF-8?q?=E9=A1=B5=E6=A8=AA=E5=B9=85=E9=9B=B6=E9=97=B4=E8=B7=9D=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=EF=BC=89=EF=BC=9B=E9=80=89=E4=B8=AD=E9=A1=B9=E8=83=8C?= =?UTF-8?q?=E6=99=AF=EF=BC=9D=E7=AB=A0=E8=8A=82=E8=89=B2=EF=BC=88=E4=B8=8E?= =?UTF-8?q?=E7=AB=A0=E5=A4=B4=E6=A8=AA=E5=B9=85=E7=BB=9F=E4=B8=80=EF=BC=8C?= =?UTF-8?q?=E4=B9=A6=E6=9E=B6=E9=80=89=E4=B8=AD=20ink=EF=BC=89=EF=BC=9B?= =?UTF-8?q?=E5=AD=97=E4=BD=93=E7=B3=BB=E7=BB=9F=EF=BC=8816px=20=E5=9F=BA?= =?UTF-8?q?=E5=87=86=3D=E6=AD=A3=E6=96=87=20/=20t1-t3=20=E4=B8=89=E7=BA=A7?= =?UTF-8?q?=E6=A0=87=E9=A2=98=20/=20=E5=B0=8F=E5=AD=97=E4=B8=A4=E6=80=81?= =?UTF-8?q?=20mute=C2=B7strong=20/=20=E5=A4=A7=E5=AD=97=E4=B8=A4=E6=80=81?= =?UTF-8?q?=20t1=C2=B7=E5=B9=BD=E7=81=B5=20display=20=E7=AB=A0=E5=8F=B7?= =?UTF-8?q?=EF=BC=89=E5=85=A8=E7=AB=99=E5=BA=94=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/tutorial/src/components/ChapterPage.tsx | 27 ++++++----- apps/tutorial/src/lib/ui.tsx | 51 +++++++++++--------- apps/tutorial/src/pages/index/App.tsx | 1 + apps/tutorial/src/styles/tokens.css | 37 ++++++++++++++ 4 files changed, 82 insertions(+), 34 deletions(-) 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); +}