Skip to content

Fix mobile header background and sidebar toggle#88

Merged
ronaldtse merged 1 commit intomainfrom
fix/mobile-header-and-sidebar
May 6, 2026
Merged

Fix mobile header background and sidebar toggle#88
ronaldtse merged 1 commit intomainfrom
fix/mobile-header-and-sidebar

Conversation

@ronaldtse
Copy link
Copy Markdown
Contributor

Two mobile rendering fixes:

1. Mobile header transparent background
The critical inline CSS in head.html positioned #nav-header as fixed but never set background-color. The Tailwind bg-white class loads asynchronously via Vite, causing the header to be transparent on mobile — text floated over underlying content.

Fix: Add background-color:#fff!important (and dark mode #0f172a) to the critical CSS in head.html.

2. Mobile sidebar toggle stretches to full page height
On pages with a sidebar (e.g., /icalendar/), shrinking the viewport caused .mobile-sidebar-toggle to stretch vertically into a non-functional tall button. Root cause: .documentation is display:flex (row direction), and the toggle was a flex child stretching to match the article sibling height.

Fix: Switch .documentation to flex-direction: column on mobile. The toggle button is now display:none by default and only shown via mobile media query. Also added the missing click handler for #mobile-sidebar-toggle to actually toggle the sidebar drawer.

- Add background-color to #nav-header in critical CSS (fixes
  transparent header on mobile while Tailwind loads)
- Add dark mode background for header in critical CSS
- Fix mobile sidebar toggle stretching to full content height by
  switching .documentation to flex-direction: column on mobile
- Change .mobile-sidebar-toggle to display:none by default, show
  only on mobile via media query
- Add click handler for #mobile-sidebar-toggle to open/close sidebar
  drawer and backdrop
- Remove duplicate .docs-nav display:none media query
@ronaldtse ronaldtse merged commit 8491274 into main May 6, 2026
3 checks passed
@ronaldtse ronaldtse deleted the fix/mobile-header-and-sidebar branch May 6, 2026 07:33
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.

1 participant