Skip to content

armgit / peach

Public Imported from GitHub
0

Peach: Local-first video metadata scraper and media manager.

feat(web): 页面标题补上 24px 那一档,行高对齐实测的 Geist Heading 32

longmeidaoaee9742e2d11
diff --git a/docs/reference-snapshots/vercel-geist-typography.md b/docs/reference-snapshots/vercel-geist-typography.md
new file mode 100644
index 000000000..77bad4de1
--- /dev/null
+++ b/docs/reference-snapshots/vercel-geist-typography.md
@@ -0,0 +1,53 @@
+# Vercel Geist Typography 实测
+
+> 本文是 Peach 的人工取证笔记,不在 `reference-sources.json` 里登记:
+> 该页由 React 渲染,数值只能从计算样式读出,给不出可哈希的上游快照。
+
+- 取证日期:2026-09-04
+- 取证入口:应用内浏览器打开 `https://vercel.com/geist/text`,对示例元素跑 `getComputedStyle`
+- 复核方式:重开该页,取任一 `[class*="text-heading-"]` 元素读 `fontSize/lineHeight/letterSpacing/fontWeight`
+- 未取得:上游 Markdown 源(该站对 `text/markdown` 返回 400),Figma 数值只能从渲染结果反推
+
+## 通道
+
+Geist 把排版发成 Tailwind 类,分四组:`text-heading-*`(引导页面与区块)、`text-button-*`
+(只用在按钮里)、`text-label-*`(单行,配图标)、`text-copy-*`(多行正文,行高比 label 高)。
+类名里的数字就是字号。`<strong>` 嵌在这些类下面即取得 Subtle / Strong 修饰。
+
+## Heading 实测值
+
+| 类 | 字号 | 行高 | 字距 | 字重 |
+| --- | --- | --- | --- | --- |
+| `text-heading-72` | 72px | 72px | -4.32px | 600 |
+| `text-heading-64` | 64px | 64px | -3.84px | 600 |
+| `text-heading-56` | 56px | 56px | -3.36px | 600 |
+| `text-heading-48` | 48px | 56px | -2.88px | 600 |
+| `text-heading-40` | 40px | 48px | -2.40px | 600 |
+| `text-heading-32` | 32px | 40px | -1.28px | 600 |
+| `text-heading-20` | 20px | 26px | -0.40px | 600 |
+| `text-heading-16` | 16px | 24px | -0.32px | 600 |
+| `text-heading-14` | 14px | 20px | -0.28px | 600 |
+
+`text-heading-24` 那一行在页面上和相邻示例共用容器,选择器取到的是 40px 那一枚,
+所以 24 这一档的行高与字距**未取得**;档位本身在表里明确存在。字距一律是 -0.04em
+(72px 档是 -0.06em),行高在 32px 及以上收敛到 1.0–1.25。
+
+## Label 与 Copy 的分工
+
+`text-label-14` 被标为「最常用的文字样式,用在大量菜单里」,`text-copy-14` 被标为
+「最常用的正文样式」。区别只在行高:label 20px,copy 20px,但 copy 在 16px 以上
+明显更松(`text-copy-18` 是 18/28,`text-label-18` 是 18/20)。数字用 `text-label-13`
+并开 tabular。
+
+## Peach 的采用与差异
+
+- 页面标题(`.pagetitle`/`.listtitle`/`.managetitle`/`.index .ihead h2`/`.playlistpage h2`)
+ 取 Heading 32:32px、600、行高 1.25(= 40px)。
+- 窄屏两级往下收:`max-width:760px` 走 Heading 24 那一档(`--fs-2xl`),
+ `max-width:640px` 才到 Heading 20(`--fs-xl`)。
+- **字距不照抄**:Geist 的 -0.04em 是给拉丁字母调的,压在中文标题上会把字挤成一团,
+ Peach 保留 -0.01em。这是本仓库对该规范唯一的显式偏离。
+- 标题外边距 Geist 没有规定,Peach 自己定为下 20px(索引页与关注页记在
+ `.ihead`/`.followhead` 上,三处同值)。
+
+最后复核:2026-09-04
diff --git a/tests/test_web_ui.py b/tests/test_web_ui.py
index 797d583df..c9fa8777f 100644
--- a/tests/test_web_ui.py
+++ b/tests/test_web_ui.py
@@ -3239,8 +3239,30 @@ class WebUiSourceTests(unittest.TestCase):
self.assertPageLacks(".index .ihead h2{margin:0;font-size:20px;font-weight:500}")
self.assertPageLacks(".playlistpage h2{margin:0 0 5px;font-size:28px}")
self.assertPageContains('<h2 class="disp pagetitle">关注</h2>')
- self.assertPageContains(".listtitle,.managetitle,.follow>.pagetitle{margin:0 0 12px}")
+ self.assertPageContains(".listtitle,.managetitle,.follow>.pagetitle{margin:0 0 20px}")
self.assertPageContains('id="listTitle" hidden')
+ # 索引页和关注页的标题外边距记在各自的头部容器上,三处必须是同一个值。
+ self.assertPageContains(".index .ihead{display:flex;align-items:center;gap:12px;margin-bottom:20px}")
+ self.assertPageContains(
+ ".followhead{display:flex;align-items:center;justify-content:space-between;"
+ "gap:14px;margin-bottom:20px}")
+
+ def test_page_titles_step_down_twice_instead_of_falling_straight_to_phone_size(self):
+ """标题分两级往下收:平板宽度走 24px,真手机才到 20px。
+
+ 一步从 32 掉到 20 会把页面标题压得比它下面 24px 的指标数字还小,层级整个
+ 翻过来——用户在 720px 的窗口里看到的就是那个 20px。24 这一档是 Geist 自己
+ 就有的 Heading 24,不是新开的字号;行高 1.25 也取自实测的 Heading 32。
+ """
+ self.assertPageContains(
+ " .pagetitle,.listtitle,.managetitle,.index .ihead h2,.playlistpage h2"
+ "{font-size:var(--fs-2xl)}")
+ self.assertPageContains(
+ "@media (max-width:640px){\n"
+ " .pagetitle,.listtitle,.managetitle,.index .ihead h2,.playlistpage h2"
+ "{font-size:var(--fs-xl)}\n}")
+ # 三档都必须在既有刻度里,新增字号前先证明现有 8 档都不合适。
+ self.assertPageContains("--fs-xl:20px; --fs-2xl:24px; --fs-3xl:32px;")
def test_immersive_progress_bar_is_reachable_and_draggable(self):
"""4px 高、贴在屏幕最下沿、只能点不能拖——鼠标难瑞,手机几乎摸不到。"""
@@ -4522,7 +4544,7 @@ class WebUiSourceTests(unittest.TestCase):
self.assertPageContains(".settinggroup .settingrow{margin:0 -16px;padding-left:16px;padding-right:16px}")
self.assertCode(
".pagetitle,.listtitle,.managetitle,.index .ihead h2,.playlistpage h2{"
- "\n font-size:var(--fs-3xl);line-height:1.15;letter-spacing:-.01em;font-weight:600}")
+ "\n font-size:var(--fs-3xl);line-height:1.25;letter-spacing:-.01em;font-weight:600}")
# 全站字体栈必须有 CJK sans 兜底:Bahnschrift/Consolas 都没有中文字形,
# generic sans-serif/monospace 在中文 Chrome 的默认可能落到宋体。
css = stylesheet_source()
diff --git a/web/css/06-index.css b/web/css/06-index.css
index ab44f230b..f10534cea 100644
--- a/web/css/06-index.css
+++ b/web/css/06-index.css
@@ -2,7 +2,7 @@
.index{padding:4px 0 20px;min-width:0;max-width:100%;overflow-x:clip}
/* 实体吸顶栏用负边距把分隔线铺到 main 左右边缘;默认的横向裁剪会把这 16 px 截掉。 */
body.entity-open .index{overflow-x:visible}
-.index .ihead{display:flex;align-items:center;gap:12px;margin-bottom:14px}
+.index .ihead{display:flex;align-items:center;gap:12px;margin-bottom:20px}
.index .ihead h2{margin:0}
.indexheading{display:inline-flex;align-items:center;gap:9px}.indexheading svg{width:25px;height:25px;stroke:currentColor;fill:none;stroke-width:1.8}
.index .ihead .geist-search{flex:1;max-width:320px;margin-left:auto}
diff --git a/web/css/11-identity.css b/web/css/11-identity.css
index 51b6a9333..18dffc395 100644
--- a/web/css/11-identity.css
+++ b/web/css/11-identity.css
@@ -44,9 +44,11 @@ button.serieslink{cursor:pointer}.serieslink:not(.entitylink){cursor:default}
button.serieslink.entitylink:hover{color:var(--tungsten);text-decoration:none}
/* 页面标题只有一套字形。原来管理区 26px、索引页 20px、播放列表 28px,
在侧栏里一路点过去就是三种大小;间距由各自的版式决定,字形不再各拍各的。 */
+/* 行高 1.25 取自 2026-09-04 实测的 Geist Heading 32(32px/40px/600)。字距那一档
+ 不照抄:Geist 的 -0.04em 是给拉丁字母调的,压在中文标题上会把字挤成一团。 */
.pagetitle,.listtitle,.managetitle,.index .ihead h2,.playlistpage h2{
- font-size:var(--fs-3xl);line-height:1.15;letter-spacing:-.01em;font-weight:600}
-.listtitle,.managetitle,.follow>.pagetitle{margin:0 0 12px}
+ font-size:var(--fs-3xl);line-height:1.25;letter-spacing:-.01em;font-weight:600}
+.listtitle,.managetitle,.follow>.pagetitle{margin:0 0 20px}
.listtitle[hidden],.managetitle[hidden]{display:none}
.dupactions{display:flex;gap:8px;margin-bottom:16px}
/* 这两个是会动数据的批量操作(每组只留一个,其余进回收站),必须看着像按钮,
diff --git a/web/css/19-immersive.css b/web/css/19-immersive.css
index 31ce1c252..7810d5543 100644
--- a/web/css/19-immersive.css
+++ b/web/css/19-immersive.css
@@ -183,7 +183,7 @@
.stats h2{font-size:var(--fs-xl)}.stats .insightcopy h2{font-size:var(--fs-3xl)}
/* 窄屏下标题也得一起缩。`/follow` 渲染在 `#stats` 里,上面那条 `.stats h2`
会只把它打到 23px,而 `#manageTitle` 在 `#stats` 外面,手机上又变成两种大小。 */
- .pagetitle,.listtitle,.managetitle,.index .ihead h2,.playlistpage h2{font-size:var(--fs-xl)}
+ .pagetitle,.listtitle,.managetitle,.index .ihead h2,.playlistpage h2{font-size:var(--fs-2xl)}
.kv .u{display:block;margin-left:0;margin-top:2px}
.ctags .tg:nth-child(n+3){display:none}
.tokstage,.tokstage.wide{inset:0;width:100%;height:100%;aspect-ratio:auto;transform:none}
@@ -199,6 +199,12 @@
/* 这个 16px 是 iOS 的阈值,不是刻度里的一档:Safari 对小于 16px 的输入框会自动放大页面。
所以它写死,不跟 --fs-lg 走——刻度改一档就把这个防放大保护悄悄破坏掉了。 */
@media (max-width:760px){input,textarea,select{font-size:16px!important}}
+/* 标题分两级往下收:平板宽度走 24px,真手机才到 20px。一步从 32 掉到 20 会把
+ 页面标题压得比它下面 24px 的指标数字还小,层级整个翻过来。24 这一档是 Geist
+ 自己就有的 Heading 24,不是新开的字号。 */
+@media (max-width:640px){
+ .pagetitle,.listtitle,.managetitle,.index .ihead h2,.playlistpage h2{font-size:var(--fs-xl)}
+}
#searchBtn{display:none}
.searchback{display:none}
.reviewimage{width:160px;height:112px;border-radius:var(--surface-radius);overflow:hidden;background:#000;margin:8px 0}.reviewimage img{width:100%;height:100%;object-fit:contain;display:block}
diff --git a/web/css/21-online.css b/web/css/21-online.css
index f8667110a..e427866e9 100644
--- a/web/css/21-online.css
+++ b/web/css/21-online.css
@@ -1,6 +1,6 @@
/* ── 在线追更 ── */
.follow{padding:4px 0 42px}
-.followhead{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-bottom:14px}
+.followhead{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-bottom:20px}
.followhead .pagetitle{margin:0}
.follow .fcheck{font-weight:600}
.follow .fcheck svg{width:14px;height:14px;stroke:currentColor;fill:none;stroke-width:2}