Make sidebar a responsive off-canvas drawer on mobile

The fixed 260px sidebar overlapped page content on phones. Below
768px it now slides off-canvas behind a hamburger top bar with 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:
lucioandClaude Opus 4.8 committed 2026-06-06 13:33:55 -07:00
1 parent 62d799a60d
commit 52b3a69b89
5 files changed
+123 -1

No files matched your search

+70
View File
@@ -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,31 @@ tr:last-child .actions-dropdown-menu {
.items-grid {
grid-template-columns: 1fr;
}
/* 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;
}
}