Skip to content

[optimize] 统一主导航文字状态,优化下拉菜单的触发和对齐 #123

Closed

Description

@TechQuery

Task description

现有问题

在官网首页的桌面端主导航中:

  1. 「开源悬赏」和「开源图书馆」默认显示为白色,其他导航项为灰色,容易被误认为是当前选中项。
  2. 鼠标悬停在带下拉菜单的导航项上时,菜单不会展开,需要额外点击。
  3. 下拉面板的左边缘与触发按钮不对齐,背景和边框也与深色导航栏缺少视觉衔接。

解决方案

  • 统一未选中导航项的默认文字颜色,保留悬停、键盘聚焦和当前页面的视觉反馈。
  • 桌面端支持鼠标悬停展开。指针从按钮移入菜单时保持展开,离开两者后收起。触屏端使用点击展开和收起,键盘仍可用 Enter 或 Space 打开、Esc 关闭。
  • 桌面端默认将下拉面板与触发按钮居中对齐,靠近视口边缘时调整位置以避免裁切。菜单背景、边框和悬停色沿用主导航的深色主题。

Reward currency

YIW $

Reward amount

90

Reward payer

yiwei yiwei@fcc-cd.dev

Task source

https://open-source-bazaar.feishu.cn/record/WwktrlCEFeNVVecDGRdcArd9ndc

Activity

  1. TechQuery commented on Nov 20, 2026

    @TechQuery
    MemberAuthor

    2. 鼠标悬停在带下拉菜单的导航项上时,菜单不会展开,需要额外点击。

    @dethan3 一级下拉菜单不用鼠标悬停展开是 Bootstrap 刻意的设计,不是 bug,这篇文档中有详情链接:https://getbootstrap.com/docs/6.0/components/menu/#overview

    导航栏下拉菜单完全使用上游默认样式,你提到的其它问题要结合上游文档与源码进一步检查是哪一层的问题:

    1. https://getbootstrap.com/docs/6.0/components/navbar/#nav
    2. https://idea-react.pages.dev/components/navbar/#nav
  2. dethan3 commented on Nov 20, 2026

    @dethan3
    Member
    1. 鼠标悬停在带下拉菜单的导航项上时,菜单不会展开,需要额外点击。

    @dethan3 一级下拉菜单不用鼠标悬停展开是 Bootstrap 刻意的设计,不是 bug,这篇文档中有详情链接:https://getbootstrap.com/docs/6.0/components/menu/#overview

    导航栏下拉菜单完全使用上游默认样式,你提到的其它问题要结合上游文档与源码进一步检查是哪一层的问题:

    1. https://getbootstrap.com/docs/6.0/components/navbar/#nav
    2. https://idea-react.pages.dev/components/navbar/#nav

    谢谢补充,第 2 点算是 UX 优化,不是 Bootstrap 的 bug,我提议优化导航的一项交互优化:桌面端用鼠标浏览时,可以悬停展开一级菜单,少一次点击就能看到子栏目,同时保留触屏点击和键盘操作。
    其他两点会按照文档优化代码。

  3. moved this from Ready to In progress in 官网项目群on Nov 20, 2026
  4. moved this from In progress to Done in 官网项目群on Nov 23, 2026
  5. github-actions commented on Nov 23, 2026

    @github-actions
    Contributor

    Reward data

    - issue: "#123"
      payer: "@yiwei <yiwei@fcc-cd.dev>"
      payee: "@dethan3"
      currency: YIW $
      reward: 90
      source: https://open-source-bazaar.feishu.cn/record/WwktrlCEFeNVVecDGRdcArd9ndc
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions