-
Notifications
You must be signed in to change notification settings - Fork 13
fix: mobile nav bar #701
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: mobile nav bar #701
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -370,6 +370,47 @@ table td { | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| color: #000000; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| /* Ensure mobile navbar sidebar uses full viewport height */ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| .navbar-sidebar { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| top: 0; /* start at very top */ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| bottom: 0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| height: 100dvh; /* modern mobile viewport unit */ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| display: flex; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| flex-direction: column; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| @supports not (height: 100dvh) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| .navbar-sidebar { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| height: 100vh; /* fallback */ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| .navbar-sidebar__items { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| margin-top: var(--ifm-navbar-height); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| height: calc(100dvh - var(--ifm-navbar-height)); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| max-height: calc(100dvh - var(--ifm-navbar-height)); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| overflow: visible; /* avoid clipping links; let inner list handle scroll */ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| flex: 1 1 auto; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| /* Let the inner list area scroll instead of the container */ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| .navbar-sidebar__item.menu { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| overflow-y: auto; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+388
to
+399
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Scrollable area assigned to wrong element; results in no scrolling The container (.navbar-sidebar__items) has fixed height but overflow: visible; putting overflow-y: auto on the inner .menu won’t create a scrollable region. The scroll should live on the sized container. .navbar-sidebar__items {
margin-top: var(--ifm-navbar-height);
height: calc(100dvh - var(--ifm-navbar-height));
max-height: calc(100dvh - var(--ifm-navbar-height));
- overflow: visible; /* avoid clipping links; let inner list handle scroll */
+ overflow: hidden; /* contain contents */
+ overflow-y: auto; /* scrolling lives here */
+ -webkit-overflow-scrolling: touch; /* iOS smooth scrolling */
flex: 1 1 auto;
}
/* Let the inner list area scroll instead of the container */
.navbar-sidebar__item.menu {
- overflow-y: auto;
+ overflow: visible; /* no scroll here */
}📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| /* While sidebar is open, ensure clicks go to the sidebar, not the navbar */ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| .navbar.navbar-sidebar--show .navbar__inner { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| pointer-events: none; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| .navbar.navbar-sidebar--show .navbar-sidebar { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| z-index: 10001; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+406
to
+408
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is needed to show in front of the "ask ai" box |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| .navbar.navbar-sidebar--show .navbar-sidebar__backdrop { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| z-index: 10000; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| /* Clean doc item styling */ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| .theme-doc-markdown { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| line-height: 1.7; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Fallback incomplete: .navbar-sidebar__items still uses 100dvh
On browsers without 100dvh, the calc() using 100dvh in the items block becomes invalid, breaking layout.
@supports not (height: 100dvh) { .navbar-sidebar { height: 100vh; /* fallback */ } + .navbar-sidebar__items { + height: calc(100vh - var(--ifm-navbar-height)); + max-height: calc(100vh - var(--ifm-navbar-height)); + } }📝 Committable suggestion