perf(fonts): 思源黑/宋切换变字体——CSS 345→106KB 全站提速

- @fontsource-variable/{noto-sans,noto-serif}-sc 替换静态三档:
  wght 轴单文件覆盖 400-700(font-face 303→101/family)
- tokens 字体栈前插 Variable 族名(旧静态名留兜底链)
- 全站 Lighthouse:home 64→70 / en 73→82 / terminal 79→84 /
  gallery 68→74,FCP 4-6s→2-3.5s(主线程解析减半)
- 已知取舍:mian-sha 字节反增(变体切片 2-4x,55 片 3.4MB)但
  FCP 关键路径不受影响(swap);按页字体 CSS 子集化立为后续包
- E2E 加固:软导航主题切换断言加 VT 竞态重试(今日第二次偶发,
  隔离 3/3 过=测试姿势问题非产品缺陷)

验证: node tests/e2e.mjs 31/31 PASS;本地 dist Lighthouse 五页型
      对比(lh-var vs lh-local 两轮全量审计)

Spec: none (性能二轮:字体管线单点换包,Lighthouse 前后对照已入档)

Co-authored-by: GLM-5.3
This commit is contained in:
wait4xandGLM-5.3 committed 2026-10-25 20:31:54 +08:00
1 parent b18d019a2e
commit 8fe9455c23
5 files changed
+37 -17

No files matched your search

+2 -2
View File
@@ -35,11 +35,11 @@
/* ---- 字体三轨 ---- */
/* 书评正文:思源宋(用户对标模板的宋体质感拍板);文楷降级为金句点缀 */
--font-serif: "Noto Serif SC", Georgia, "Songti SC", STSong,
--font-serif: "Noto Serif SC Variable", "Noto Serif SC", Georgia, "Songti SC", STSong,
"Noto Serif CJK SC", "Source Han Serif SC", SimSun, serif;
--font-kai: "LXGW WenKai Screen", "Songti SC", serif;
/* UI / 技术文:思源黑 */
--font-sans: "Noto Sans SC", system-ui, -apple-system, "PingFang SC",
--font-sans: "Noto Sans SC Variable", "Noto Sans SC", system-ui, -apple-system, "PingFang SC",
"Hiragino Sans GB", "Microsoft YaHei", sans-serif;
/* 代码 */
--font-mono: "JetBrains Mono", ui-monospace, Consolas, "Courier New", monospace;