mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
fix(docs-infra): keep mobile nav drawers usable on small screens
On phones, opening the primary-nav drawer left the page behind it scrollable, and the secondary drawer's mask had no explicit height so long submenus got clipped above the page content. Lock the page with overflow: clip on :host:has(.adev-nav-primary--open) for phone-only (preserves the primary nav's sticky context), give the secondary mask height: 100dvh on tablet-landscape-down so it fills the visible viewport, and align the nav-list :host height to 100dvh too so its inner scroll matches.
(cherry picked from commit 441a00d665)
This commit is contained in:
parent
3430251fef
commit
e6ab5eca57
3 changed files with 9 additions and 1 deletions
|
|
@ -6,7 +6,7 @@
|
|||
list-style: none;
|
||||
overflow-y: auto;
|
||||
overflow-x: hidden;
|
||||
height: 100vh;
|
||||
height: 100dvh;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
padding-block: 1.5rem;
|
||||
|
|
|
|||
|
|
@ -40,6 +40,13 @@
|
|||
}
|
||||
}
|
||||
|
||||
// Lock the page behind the mobile primary-nav drawer. `clip` preserves the primary nav's sticky context.
|
||||
@include mq.for-phone-only {
|
||||
&:has(.adev-nav-primary--open) {
|
||||
overflow: clip;
|
||||
}
|
||||
}
|
||||
|
||||
&:has(.adev-home) {
|
||||
.adev-nav {
|
||||
width: 0;
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@
|
|||
|
||||
@include mq.for-tablet-landscape-down {
|
||||
position: absolute;
|
||||
height: 100dvh;
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: no-preference) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue