From eddfbd2defbadee7a6fac2416699ee412df6dff3 Mon Sep 17 00:00:00 2001 From: maoyingjie Date: Sat, 24 Oct 2026 07:44:12 +0800 Subject: [PATCH] fix(docs): align navigation colors and remove hover underlines --- AGENTS.md | 1 + apps/docs/.vitepress/theme/Layout.vue | 5 ---- apps/docs/.vitepress/theme/shell.css | 36 +++++++++++++++++---------- docs/verification.md | 4 +++ 4 files changed, 28 insertions(+), 18 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index f1789fb..6242221 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -479,3 +479,4 @@ DateField/DateInputGroup 已公开,先读[DATE-02 报告](docs/migrations/DATE - 视觉验收必须用同视口官网页面核对实际背景、字号、留白、卡片列数和预览内容,不把源码参数或功能回归通过当成视觉一致。总览不能擅自改成纯文字摘要卡;目录 Link 须清除默认圆角,防止选中线弯曲。官方 CDN 缩略图仅用于设计预览,保留加载失败降级,不冒充 Vue 运行结果。 - 公共壳层须单独验收 Header/Search:CSS 用实际 `--field-background`,不能把 Tailwind 的 bg-field 当作存在 `--field` 变量。核对计算颜色与透明度;搜索遮罩按主题局部适配,不能直接拿 Modal 默认遮罩代表官网搜索。两行导航无中间边框、桌面 gap 4px,sticky 总高度和移动端一起检查。 - 使用组件发现异常时先核对默认组件、真实 DOM 和覆盖来源;若是组件本身问题,修组件及行为回归,不在文档藏补丁。文档不得清零 Button 内边距后再叠图标负边距;版本使用原生 button 的 PopoverTrigger,链接按钮使用 Button asChild + a 保留导航语义,ToggleButtonGroup 分离模式用 isDetached,不重写其尺寸/间距。定制配色用组件提供的状态变量。 +- 左右文档导航遵循 Fumadocs 中性灰和 400 字重,不直接复用组件 muted 色或 Link 的默认 500 字重;导航禁用 hover/pressed 下划线,仍保留焦点环。普通正文 Link 的默认下划线行为不变,不能为导航定制而全局修改 Link。框架切换区域按用户要求留空,不显示 Vue 3 标记。 diff --git a/apps/docs/.vitepress/theme/Layout.vue b/apps/docs/.vitepress/theme/Layout.vue index 51d2d87..bf93db9 100644 --- a/apps/docs/.vitepress/theme/Layout.vue +++ b/apps/docs/.vitepress/theme/Layout.vue @@ -43,7 +43,6 @@ import { IconComponents, IconList, IconChevronDown, - IconBrandVue, IconBrandGithub, IconArrowLeft, IconArrowRight, @@ -325,10 +324,6 @@ async function copyMarkdownCode(event: MouseEvent) { 组件 - -
diff --git a/apps/docs/.vitepress/theme/shell.css b/apps/docs/.vitepress/theme/shell.css index dabb411..2a8c316 100644 --- a/apps/docs/.vitepress/theme/shell.css +++ b/apps/docs/.vitepress/theme/shell.css @@ -5,6 +5,14 @@ --docs-header-height: 100px; --docs-sidebar-width: 220px; --docs-toc-width: 268px; + /* Fumadocs neutral navigation colors, separate from component muted text. */ + --docs-nav-muted: var(--color-neutral-500, #737373); + --docs-nav-foreground: oklch(0.14 0 0); + --docs-nav-hover: rgb(0 0 0 / 4%); +} +.dark { + --docs-nav-foreground: oklch(0.99 0 0); + --docs-nav-hover: rgb(255 255 255 / 6%); } html { scroll-padding-top: 154px; @@ -134,9 +142,6 @@ html { border-color: var(--accent); color: var(--foreground); } -.docs-nav-sections .framework { - margin: 0 0 6px auto; -} .docs-theme-wide { padding: 2px; border-radius: 999px; @@ -188,6 +193,7 @@ html { padding: 4px 8px; font-size: 14px; font-weight: 500; + color: var(--docs-nav-foreground); } .sidebar-tree .hv-link { display: flex; @@ -196,19 +202,21 @@ html { margin: 2px 0; font-size: 14px; line-height: 20px; - color: var(--muted); + color: var(--docs-nav-muted); + font-weight: 400; + text-decoration: none; border-radius: var(--radius-field); word-break: keep-all; overflow-wrap: break-word; } -.sidebar-tree .hv-link:hover { - background: var(--default-soft); - color: var(--foreground); +.sidebar-tree .hv-link:is(:hover, [data-hovered="true"]) { + background: var(--docs-nav-hover); + color: color-mix(in oklab, var(--docs-nav-foreground) 80%, transparent); } .sidebar-tree .hv-link[aria-current="page"] { background: var(--surface); box-shadow: var(--surface-shadow); - color: var(--foreground); + color: var(--docs-nav-foreground); } .community { font-size: 11px; @@ -269,7 +277,7 @@ html { display: flex; align-items: center; gap: 6px; - color: var(--muted); + color: var(--docs-nav-muted); font-size: 14px; margin: 0 0 16px; } @@ -288,20 +296,22 @@ html { padding: 6px 8px 6px 12px; line-height: 1.5; font-size: 13px; - color: var(--muted); + color: var(--docs-nav-muted); + font-weight: 400; + text-decoration: none; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; } .toc-links .hv-link[aria-current="location"] { - box-shadow: inset 1px 0 var(--foreground); + box-shadow: inset 1px 0 var(--docs-nav-foreground); } .toc-links .hv-link.nested { padding-left: 24px; } -.toc-links .hv-link:hover, +.toc-links .hv-link:is(:hover, [data-hovered="true"]), .toc-links .hv-link[aria-current="location"] { - color: var(--foreground); + color: var(--docs-nav-foreground); } .mobile-toc { display: none; diff --git a/docs/verification.md b/docs/verification.md index 753f62b..bc61d85 100644 --- a/docs/verification.md +++ b/docs/verification.md @@ -894,3 +894,7 @@ M35/M36 合并最新 main 后:68 文件/849 项、typecheck、build:docs 通 ### Header 控件组合修正 Button/PopoverTrigger/Link/ToggleButtonGroup 源码及几何复核后,移除文档错误组合与尺寸覆盖,使用原生版本触发器、标准链接按钮及 isDetached 主题组。新增原生触发器/源码 anchor/分离组/版本展开回归。相关 **3 文件 / 68 项通过**,typecheck、build:docs、全仓 Prettier/diff 通过;仍有既存 chunk 提示。真实浏览器核对文字/图标中心、点击区、4px 组间距、版本展开/关闭和方向键 + Space 主题切换;范围与截图见 [DOCS-01 控件组合复核](migrations/DOCS-01-shell-alignment.md)。本轮未改库默认实现,没有重新宣称完整测试数量或独立产物验收。 + +### 左右导航配色与悬浮状态 + +实际官网深色导航读数为中性灰 lab(48.496 0 0)、400 字重,与 Tailwind neutral-500 对应;本地原为偏冷的组件 muted/500 字重,现已分离文档导航颜色。普通项中性灰、当前项中性前景,侧栏保留选中表面/阴影,右侧保留章节指示线。两侧导航覆盖装饰线而不更改普通 Link 默认契约,浏览器实际 :hover/data-hovered 状态的 textDecorationLine=none,焦点环不移除。主题深浅色及导航跳转验证,壳层 **12 项**、typecheck、build:docs、格式/diff 检查通过;构建仍有既存 chunk 提示。本轮同时移除上一请求的 Vue 3 标记及废弃样式,框架位置留空。截图 `/private/tmp/heroui-docs-navigation-review.png`,不扩大为整站逐像素验收。