fix: fix layout spacing and make topbar fixed position
- Removed duplicate main-wrapper div that caused large gap - Changed topbar from sticky to fixed position - Topbar now stays at top across all section loads - Added margin-top to page-content to account for fixed topbar - Updated sidebar toggle to also move topbar position - Layout: sidebar (fixed) | topbar (fixed) | content (scrollable)
This commit is contained in:
@@ -233,8 +233,10 @@
|
||||
|
||||
/* ============ TOPBAR ============ */
|
||||
.topbar {
|
||||
position: sticky;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: var(--sidebar-width);
|
||||
right: 0;
|
||||
height: var(--topbar-height);
|
||||
background: var(--card-bg);
|
||||
border-bottom: 1px solid var(--card-border);
|
||||
@@ -243,6 +245,19 @@
|
||||
justify-content: space-between;
|
||||
padding: 0 32px;
|
||||
z-index: 100;
|
||||
transition: left 0.3s ease;
|
||||
}
|
||||
|
||||
.page-content {
|
||||
padding: 32px;
|
||||
overflow-x: hidden;
|
||||
margin-top: var(--topbar-height);
|
||||
}
|
||||
|
||||
.page-content {
|
||||
padding: 32px;
|
||||
overflow-x: hidden;
|
||||
margin-top: var(--topbar-height);
|
||||
}
|
||||
|
||||
.topbar-left {
|
||||
@@ -1245,8 +1260,6 @@
|
||||
</aside>
|
||||
|
||||
<!-- ============ MAIN CONTENT ============ -->
|
||||
|
||||
<div class="main-wrapper">
|
||||
<div class="main-wrapper">
|
||||
<!-- Topbar -->
|
||||
<header class="topbar">
|
||||
@@ -1537,6 +1550,7 @@
|
||||
if (isCollapsed) {
|
||||
sidebar.css('width', '280px');
|
||||
$('.main-wrapper').css('margin-left', '280px');
|
||||
$('.topbar').css('left', '280px');
|
||||
$('.sidebar-logo-text, .sidebar-section-title, .sidebar-link span, .sidebar-link .badge, .sidebar-user-info, .sidebar-footer').show();
|
||||
$('.sidebar-link i').css('margin-right', '14px');
|
||||
$('.sidebar-logo').css('justify-content', 'flex-start');
|
||||
@@ -1544,6 +1558,7 @@
|
||||
} else {
|
||||
sidebar.css('width', '80px');
|
||||
$('.main-wrapper').css('margin-left', '80px');
|
||||
$('.topbar').css('left', '80px');
|
||||
$('.sidebar-logo-text, .sidebar-section-title, .sidebar-link span, .sidebar-link .badge, .sidebar-user-info, .sidebar-footer').hide();
|
||||
$('.sidebar-link i').css('margin-right', '0');
|
||||
$('.sidebar-logo').css('justify-content', 'center');
|
||||
|
||||
Reference in New Issue
Block a user