fix: overlay mobile navigation without shifting page content
This commit is contained in:
1 parent
37a4a8e2ca
commit
b776bacd70
3 files changed
+31
-6
No files matched your search
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@gabriel20xx/web-ui": patch
|
||||
---
|
||||
|
||||
Open the mobile navigation menu as an overlay below the header instead of inserting it into the header row. Opening the menu no longer pushes the page content down, and long menus scroll within the viewport.
|
||||
@@ -1111,13 +1111,23 @@ html[data-wide-layout='true'] .sc-main {
|
||||
transform: translateX(-50%);
|
||||
}
|
||||
|
||||
/* Overlay the page below the header instead of wrapping onto a new row, so opening the menu
|
||||
doesn't push the content down. */
|
||||
.sc-nav {
|
||||
display: none;
|
||||
flex-basis: 100%;
|
||||
order: 4;
|
||||
position: absolute;
|
||||
top: 100%;
|
||||
right: 0;
|
||||
left: 0;
|
||||
z-index: 20;
|
||||
flex-direction: column;
|
||||
align-items: stretch;
|
||||
padding-bottom: 0.25rem;
|
||||
max-height: calc(100dvh - 4rem);
|
||||
padding: 0.5rem 1rem 0.75rem;
|
||||
overflow-y: auto;
|
||||
background: var(--sc-surface);
|
||||
border-bottom: 1px solid var(--sc-border);
|
||||
box-shadow: var(--sc-shadow-lg);
|
||||
}
|
||||
|
||||
.sc-nav[data-open="true"] {
|
||||
|
||||
+13
-3
@@ -1111,13 +1111,23 @@ html[data-wide-layout='true'] .sc-main {
|
||||
transform: translateX(-50%);
|
||||
}
|
||||
|
||||
/* Overlay the page below the header instead of wrapping onto a new row, so opening the menu
|
||||
doesn't push the content down. */
|
||||
.sc-nav {
|
||||
display: none;
|
||||
flex-basis: 100%;
|
||||
order: 4;
|
||||
position: absolute;
|
||||
top: 100%;
|
||||
right: 0;
|
||||
left: 0;
|
||||
z-index: 20;
|
||||
flex-direction: column;
|
||||
align-items: stretch;
|
||||
padding-bottom: 0.25rem;
|
||||
max-height: calc(100dvh - 4rem);
|
||||
padding: 0.5rem 1rem 0.75rem;
|
||||
overflow-y: auto;
|
||||
background: var(--sc-surface);
|
||||
border-bottom: 1px solid var(--sc-border);
|
||||
box-shadow: var(--sc-shadow-lg);
|
||||
}
|
||||
|
||||
.sc-nav[data-open="true"] {
|
||||
|
||||
Reference in new issue
Block a user