Make sidebar a responsive off-canvas drawer on mobile
The fixed 260px sidebar overlapped page content on phones. Below 768px the app container now stacks vertically: a full-width hamburger top bar sits above the content, the sidebar slides off-canvas behind a tap/Escape-dismissable backdrop, and the main content uses full width. Co-Authored-By: Claude Opus 4.8 <[email protected]>
This commit is contained in:
1 parent
62d799a60d
commit
8e5eb387c5
5 files changed
+129
-1
No files matched your search
@@ -1098,6 +1098,50 @@ tr:last-child .actions-dropdown-menu {
|
||||
color: var(--color-brand-primary);
|
||||
}
|
||||
|
||||
/* Mobile top bar + drawer backdrop (hidden on desktop) */
|
||||
.mobile-topbar {
|
||||
display: none;
|
||||
align-items: center;
|
||||
gap: 1rem;
|
||||
padding: 0.75rem 1rem;
|
||||
background-color: var(--color-bg-surface);
|
||||
border-bottom: 1px solid var(--color-border);
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 90;
|
||||
}
|
||||
|
||||
.mobile-topbar .brand {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.mobile-menu-btn {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
padding: 0;
|
||||
background: none;
|
||||
border: 1px solid var(--color-border);
|
||||
border-radius: var(--radius-sm);
|
||||
color: var(--color-text-main);
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.mobile-menu-btn svg {
|
||||
width: 22px;
|
||||
height: 22px;
|
||||
}
|
||||
|
||||
.sidebar-backdrop {
|
||||
display: none;
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
background: rgba(0, 0, 0, 0.45);
|
||||
z-index: 99;
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.public-header {
|
||||
padding: 1rem 1.5rem;
|
||||
@@ -1108,5 +1152,37 @@ tr:last-child .actions-dropdown-menu {
|
||||
.items-grid {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
/* Stack vertically so the top bar spans full width above content
|
||||
instead of becoming a flex item beside it */
|
||||
.app-container {
|
||||
display: block;
|
||||
}
|
||||
|
||||
/* Show the mobile top bar */
|
||||
.mobile-topbar {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
/* Sidebar becomes an off-canvas drawer */
|
||||
.sidebar {
|
||||
transform: translateX(-100%);
|
||||
transition: transform 0.25s ease;
|
||||
box-shadow: var(--shadow-lg);
|
||||
}
|
||||
.sidebar.open {
|
||||
transform: translateX(0);
|
||||
}
|
||||
|
||||
/* Backdrop visible only while the drawer is open */
|
||||
.sidebar-backdrop.show {
|
||||
display: block;
|
||||
}
|
||||
|
||||
/* Content takes the full width; no reserved sidebar gutter */
|
||||
.main-wrapper {
|
||||
margin-left: 0;
|
||||
padding: 1.5rem 1.25rem;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user