先改契约最小、最清楚的视觉系统:.web/tokens.json。不要一开始就假定 theme.tone 会选择 component overlay。
一次窄范围视觉改动
- 选择一个语义目标:reading surface、accent role 或 content width。
- 修改
.web/tokens.json中对应的顶层 token 值。 - 只有 dark presentation 确实不同才加
darkoverride。 - build 后,在浅色和深色呈现中检查 home page 和 content/detail page。
- 扩大 token 集合前,先检查文本对比度、focus 可见性、图片和窄宽度换行。
这会形成一层 site-owned visual layer,component 可以复用它,而不需要另一个 component-selection mechanism。
不要猜测 theme overlay
当前 runtime 中,site.yaml 的 theme: 值用于 opt into shared theme library 和设置 AUP CSS tone/palette;不会把 .web/themes/<name>/ 选为 active component overlay。local theme tree 与 library fallback 有不同优先级。设计真的需要 local overlay 时,先建立一个小的 target-version fixture,核验精确 resolver path,再把它写成可复用 theme recipe。
token reader 不是针对不可信 CSS 的 security boundary。应像审阅 component code 一样,把该文件放进受信任审阅纪律中。
见 主题与 tokens 和 主题与 token 参考。