Skip to content

Commit 1a29ee8

Browse files
committed
style: Enhance sidebar functionality with mobile responsiveness and toggle feature
1 parent ddac2d9 commit 1a29ee8

File tree

3 files changed

+305
-60
lines changed

3 files changed

+305
-60
lines changed

src/App.css

Lines changed: 65 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,15 @@ div[style*="linear-gradient"] p {
148148
min-height: calc(100vh - 56px);
149149
margin-left: 250px;
150150
background: #f5f7fa;
151+
transition: margin-left 0.3s ease;
152+
}
153+
154+
/* Mobile Responsive Content Wrapper */
155+
@media (max-width: 991px) {
156+
.content-wrapper {
157+
margin-left: 0 !important;
158+
padding: 15px;
159+
}
151160
}
152161

153162
/* Modern Navbar */
@@ -426,9 +435,10 @@ div[style*="linear-gradient"] p {
426435
}
427436

428437
/* Responsive */
429-
@media (max-width: 768px) {
438+
@media (max-width: 991px) {
430439
.content-wrapper {
431-
margin-left: 0;
440+
margin-left: 0 !important;
441+
padding: 15px;
432442
}
433443

434444
.sidebar {
@@ -439,4 +449,57 @@ div[style*="linear-gradient"] p {
439449
.sidebar.show {
440450
transform: translateX(0);
441451
}
452+
453+
/* Adjust page headers for mobile */
454+
.page-header {
455+
padding: 20px 15px;
456+
margin-bottom: 20px;
457+
}
458+
459+
.page-header h2 {
460+
font-size: 1.5rem;
461+
}
462+
463+
/* Adjust stat cards for mobile */
464+
.stat-card {
465+
margin-bottom: 15px;
466+
}
467+
468+
.stat-card h3 {
469+
font-size: 1.8rem;
470+
}
471+
472+
/* Mobile table responsiveness */
473+
.table-responsive {
474+
font-size: 0.9rem;
475+
}
476+
}
477+
478+
@media (max-width: 768px) {
479+
.content-wrapper {
480+
padding: 10px;
481+
}
482+
483+
.card-body {
484+
padding: 15px;
485+
}
486+
487+
.btn {
488+
padding: 8px 16px;
489+
font-size: 0.9rem;
490+
}
491+
}
492+
493+
@media (max-width: 576px) {
494+
.page-header h2 {
495+
font-size: 1.25rem;
496+
}
497+
498+
.stat-card h3 {
499+
font-size: 1.5rem;
500+
}
501+
502+
.stat-card p {
503+
font-size: 0.85rem;
504+
}
442505
}

src/components/Layout/Sidebar.css

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
/* Sidebar Base Styles */
2+
.admin-sidebar {
3+
background: linear-gradient(180deg, #1a237e 0%, #0d47a1 100%);
4+
min-height: 100vh;
5+
width: 250px;
6+
position: fixed;
7+
left: 0;
8+
top: 56px;
9+
bottom: 0;
10+
overflow-y: auto;
11+
box-shadow: 2px 0 10px rgba(0,0,0,0.1);
12+
z-index: 1050;
13+
transition: left 0.3s ease-in-out;
14+
}
15+
16+
/* Desktop View - Always visible */
17+
@media (min-width: 992px) {
18+
.admin-sidebar {
19+
left: 0 !important;
20+
}
21+
22+
.sidebar-toggle-btn {
23+
display: none !important;
24+
}
25+
26+
.sidebar-overlay {
27+
display: none !important;
28+
}
29+
}
30+
31+
/* Tablet and Mobile View */
32+
@media (max-width: 991px) {
33+
.admin-sidebar {
34+
left: -250px;
35+
}
36+
37+
.admin-sidebar.open {
38+
left: 0;
39+
}
40+
}
41+
42+
/* Sidebar Toggle Button */
43+
.sidebar-toggle-btn {
44+
position: fixed;
45+
top: 70px;
46+
left: 10px;
47+
z-index: 1100;
48+
background: linear-gradient(135deg, #1a237e 0%, #0d47a1 100%);
49+
border: none;
50+
border-radius: 8px;
51+
padding: 10px 12px;
52+
color: white;
53+
cursor: pointer;
54+
box-shadow: 0 2px 8px rgba(0,0,0,0.3);
55+
display: flex;
56+
align-items: center;
57+
justify-content: center;
58+
transition: all 0.3s ease;
59+
}
60+
61+
.sidebar-toggle-btn:hover {
62+
transform: scale(1.05);
63+
box-shadow: 0 4px 12px rgba(0,0,0,0.4);
64+
}
65+
66+
.sidebar-toggle-btn:active {
67+
transform: scale(0.95);
68+
}
69+
70+
/* Sidebar Overlay */
71+
.sidebar-overlay {
72+
position: fixed;
73+
top: 0;
74+
left: 0;
75+
right: 0;
76+
bottom: 0;
77+
background: rgba(0, 0, 0, 0.5);
78+
z-index: 1040;
79+
transition: opacity 0.3s ease;
80+
opacity: 1;
81+
}
82+
83+
/* Smooth scrollbar for sidebar */
84+
.admin-sidebar::-webkit-scrollbar {
85+
width: 6px;
86+
}
87+
88+
.admin-sidebar::-webkit-scrollbar-track {
89+
background: rgba(255, 255, 255, 0.1);
90+
}
91+
92+
.admin-sidebar::-webkit-scrollbar-thumb {
93+
background: rgba(255, 255, 255, 0.3);
94+
border-radius: 3px;
95+
}
96+
97+
.admin-sidebar::-webkit-scrollbar-thumb:hover {
98+
background: rgba(255, 255, 255, 0.5);
99+
}

0 commit comments

Comments
 (0)