Fix mobile header background and sidebar toggle#88
Merged
Conversation
- 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two mobile rendering fixes:
1. Mobile header transparent background
The critical inline CSS in
head.htmlpositioned#nav-headeras fixed but never setbackground-color. The Tailwindbg-whiteclass 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 inhead.html.2. Mobile sidebar toggle stretches to full page height
On pages with a sidebar (e.g.,
/icalendar/), shrinking the viewport caused.mobile-sidebar-toggleto stretch vertically into a non-functional tall button. Root cause:.documentationisdisplay:flex(row direction), and the toggle was a flex child stretching to match the article sibling height.Fix: Switch
.documentationtoflex-direction: columnon mobile. The toggle button is nowdisplay:noneby default and only shown via mobile media query. Also added the missing click handler for#mobile-sidebar-toggleto actually toggle the sidebar drawer.