Skip to content

fix: 调整文档右侧TOC导航栏,避免遮挡主要内容#109

Merged
JusterZhu merged 1 commit into
mainfrom
fix/toc-sidebar-overlap
Jun 4, 2026
Merged

fix: 调整文档右侧TOC导航栏,避免遮挡主要内容#109
JusterZhu merged 1 commit into
mainfrom
fix/toc-sidebar-overlap

Conversation

@JusterZhu

@JusterZhu JusterZhu commented Jun 4, 2026

Copy link
Copy Markdown
Collaborator

改动说明

本次 PR 修复了文档站点右侧 TOC 导航栏容易遮挡主要内容的问题。

具体修改

属性 修改前 修改后
主内容列宽度 75% (855px) 80% (912px)
TOC 列宽度 25% (285px) 20% (228px)
内容溢出保护 overflow-x: auto
TOC 视觉分隔 左边框 + 内边距

效果

  • 主内容多获得 ~57px 水平空间
  • TOC 被推至更右侧,减少与内容的视觉重叠
  • 宽表格/代码块超出时会显示横向滚动条而非覆盖 TOC
  • 所有改动仅在桌面端生效(≥997px),移动端不受影响

修改文件

  • website/src/css/custom.css — 在 TOC 区块添加 @media (min-width: 997px) 布局覆盖

Closes #108

🤖 Generated with Claude Code

- Increase content column from 75% to 80% of container width
- Reduce TOC column from 25% to 20% to push it further right
- Add overflow-x: auto to content area to prevent wide tables/code
  from bleeding into the TOC column
- Add left border + padding on TOC for visual separation

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings June 4, 2026 11:02
@JusterZhu JusterZhu merged commit b4107fd into main Jun 4, 2026
3 checks passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

该 PR 针对 Docusaurus 文档站点桌面端(≥997px)右侧 TOC(目录)可能遮挡主要内容的问题,通过调整内容列/TOC 列比例并为内容区增加横向溢出保护,来减少视觉与布局上的重叠风险。

Changes:

  • 在桌面端将主内容列最大宽度调整为 80%,并将 TOC 列宽调整为 20%。
  • 为文档内容区域增加 overflow-x: auto,避免宽表格/代码块横向溢出覆盖 TOC。
  • 为 TOC 增加左边框与内边距,增强内容与 TOC 的视觉分隔。

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@JusterZhu JusterZhu deleted the fix/toc-sidebar-overlap branch June 9, 2026 04:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

网站文档右侧TOC导航栏遮挡主要内容

2 participants