Skip to content

Fix mobile sidebar overlap#133

Merged
ootakazuhiko merged 1 commit into
mainfrom
codex/itcomm-issue168-sidebar-overlap-20260607
Jun 7, 2026
Merged

Fix mobile sidebar overlap#133
ootakazuhiko merged 1 commit into
mainfrom
codex/itcomm-issue168-sidebar-overlap-20260607

Conversation

@ootakazuhiko

Copy link
Copy Markdown
Collaborator

Summary

  • Fixes the mobile/tablet portrait sidebar overlap for the published IT engineer communication book layout.
  • Keeps the closed drawer state off-canvas at <=1024px despite the later desktop .book-sidebar { transform: translateX(0); } rule in main.css.
  • Updates both tracked CSS copies so the published docs tree and the nested repository copy stay consistent.

Root cause

main.css imports mobile-responsive.css before declaring the default desktop sidebar transform. On mobile/tablet widths the main content margin is removed, but the later desktop transform: translateX(0) could override the mobile closed-drawer transform: translateX(-100%), causing the fixed TOC sidebar to paint over article content.

This PR makes the mobile closed-drawer transform important. The checked/open selector is already more specific and important, so the drawer still opens normally when toggled.

Verification

  • npm ci
  • npm test
  • npm run build
  • git diff --check
  • Local Jekyll docs/_site served at /IT-engineer-communication-book/; Pages visual checker over 2 pages × 5 viewports passed:
    • phone480, tablet (768px), tablet820, laptop1024, desktop
    • result: books=1 pages=10 ok=10 warn=0 fail=0
  • Direct Playwright probe over / and /chapter-quickstart/ confirmed:
    • 480/768/820/1024px: closed drawer is off-canvas, no sidebar/content overlap, menu toggle is visible, and clicking the menu opens the drawer.
    • 1280px desktop: sidebar remains visible and content starts after the sidebar.

Refs itdojp/it-engineer-knowledge-architecture#168.

Copilot AI review requested due to automatic review settings June 7, 2026 02:49
@ootakazuhiko

Copy link
Copy Markdown
Collaborator Author

@copilot review

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

This PR addresses a responsive-layout regression where the fixed TOC sidebar could overlap article content on mobile/tablet portrait widths due to main.css importing mobile-responsive.css before later applying the default desktop .book-sidebar { transform: translateX(0); } rule. The fix ensures the “closed drawer” transform remains authoritative at <=1024px while preserving the existing checked/open behavior.

Changes:

  • Make the closed mobile drawer state (transform: translateX(-100%)) !important so it can’t be overridden by the later desktop sidebar transform.
  • Add an explanatory comment documenting the cascade/root-cause and why !important is used.
  • Apply the same change to both tracked copies of mobile-responsive.css.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
IT-engineer-communication-book/docs/assets/css/mobile-responsive.css Forces closed-drawer transform to win over the later desktop sidebar transform rule at <=1024px.
docs/assets/css/mobile-responsive.css Mirrors the same closed-drawer !important transform and documentation for the published docs tree.

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

@ootakazuhiko ootakazuhiko merged commit d0a2c65 into main Jun 7, 2026
3 of 4 checks passed
@ootakazuhiko ootakazuhiko deleted the codex/itcomm-issue168-sidebar-overlap-20260607 branch June 7, 2026 02:51
Copilot stopped work on behalf of ootakazuhiko due to an error June 7, 2026 02:52
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.

2 participants