The sidebar vanished on a too small display. Button to reopen and close are rendered
175 lines
3.6 KiB
SCSS
175 lines
3.6 KiB
SCSS
@use "../variables" as *;
|
|
@use "../mixins" as *;
|
|
|
|
.sidebar {
|
|
width: 260px;
|
|
background: $color-sidebar;
|
|
color: #fff;
|
|
min-height: 100%;
|
|
padding: $spacing-md;
|
|
display: flex;
|
|
flex-direction: column;
|
|
|
|
ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: $spacing-sm; flex: 1; }
|
|
|
|
a, .menu-toggle {
|
|
color: #fff;
|
|
text-decoration: none;
|
|
display: block;
|
|
padding: 8px 12px;
|
|
border-radius: $border-radius;
|
|
transition: background 0.2s ease-in-out;
|
|
&:hover { background: rgba(255,255,255,0.1); }
|
|
}
|
|
|
|
.menu-toggle { background: transparent; border: none; text-align: left; width: 100%; cursor: pointer; }
|
|
|
|
.submenu {
|
|
margin-left: 8px;
|
|
background: rgba(255,255,255,0.05);
|
|
border-radius: $border-radius;
|
|
padding: 6px;
|
|
li { padding: 4px 0; }
|
|
}
|
|
|
|
.logout-item {
|
|
margin-top: auto;
|
|
border-top: 1px solid rgba(255,255,255,0.1);
|
|
padding-top: $spacing-sm;
|
|
}
|
|
|
|
.logout-button {
|
|
background: rgba(255, 255, 255, 0.1);
|
|
color: #fff;
|
|
border: 1px solid rgba(255, 255, 255, 0.2);
|
|
padding: 8px 12px;
|
|
border-radius: 4px;
|
|
width: 100%;
|
|
cursor: pointer;
|
|
text-align: left;
|
|
}
|
|
|
|
.sidebar-header {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
width: 100%;
|
|
margin-bottom: $spacing-md;
|
|
|
|
.home {
|
|
flex-grow: 1;
|
|
display: flex;
|
|
justify-content: center;
|
|
|
|
@media (max-width: 768px) {
|
|
padding-left: 36px;
|
|
}
|
|
}
|
|
|
|
.sidebar-close {
|
|
display: none;
|
|
background: transparent;
|
|
border: none;
|
|
color: #fff;
|
|
cursor: pointer;
|
|
padding: 8px;
|
|
border-radius: 50%;
|
|
align-items: center;
|
|
justify-content: center;
|
|
transition: background 0.2s ease-in-out;
|
|
margin-bottom: 0;
|
|
|
|
&:hover {
|
|
background: rgba(255, 255, 255, 0.1);
|
|
}
|
|
|
|
svg {
|
|
width: 20px;
|
|
height: 20px;
|
|
stroke: #fff;
|
|
}
|
|
|
|
@media (max-width: 768px) {
|
|
display: flex;
|
|
}
|
|
}
|
|
}
|
|
|
|
.home-svg {
|
|
width: 24px;
|
|
height: 24px;
|
|
vertical-align: middle;
|
|
margin-right: 8px;
|
|
}
|
|
|
|
&.user { width: 220px; background: darken($color-sidebar, 6%); }
|
|
}
|
|
|
|
// Floating mobile menu toggle button
|
|
.mobile-menu-toggle {
|
|
display: none;
|
|
|
|
@media (max-width: 768px) {
|
|
display: flex;
|
|
position: fixed;
|
|
top: 1rem;
|
|
left: 1rem;
|
|
z-index: 998;
|
|
width: 48px;
|
|
height: 48px;
|
|
border-radius: 50%;
|
|
border: 1px solid rgba(128, 128, 128, 0.2);
|
|
background-color: var(--color-container);
|
|
color: var(--color-text);
|
|
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
|
|
cursor: pointer;
|
|
align-items: center;
|
|
justify-content: center;
|
|
padding: 0;
|
|
transition: all 0.2s ease-in-out;
|
|
|
|
svg {
|
|
width: 24px;
|
|
height: 24px;
|
|
stroke: var(--color-text);
|
|
transition: stroke 0.2s ease-in-out;
|
|
}
|
|
|
|
&:hover {
|
|
transform: translateY(-1px);
|
|
box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
|
|
background-color: var(--color-bg);
|
|
}
|
|
|
|
&:active {
|
|
transform: translateY(0);
|
|
}
|
|
}
|
|
}
|
|
|
|
// Overlay backdrop that dims the screen and allows dismissals on mobile
|
|
.sidebar-overlay {
|
|
display: none;
|
|
|
|
@media (max-width: 768px) {
|
|
display: block;
|
|
position: fixed;
|
|
top: 0;
|
|
left: 0;
|
|
width: 100vw;
|
|
height: 100vh;
|
|
background: rgba(0, 0, 0, 0.4);
|
|
backdrop-filter: blur(4px);
|
|
z-index: 999;
|
|
opacity: 0;
|
|
pointer-events: none;
|
|
transition: opacity 0.3s ease-in-out;
|
|
|
|
&.open {
|
|
opacity: 1;
|
|
pointer-events: auto;
|
|
}
|
|
}
|
|
}
|
|
|