fix(nav): make top navbar horizontally scrollable on mobile without overflowing page
This commit is contained in:
parent
f138403918
commit
039b5ac483
1 changed files with 87 additions and 0 deletions
|
|
@ -22,6 +22,12 @@
|
|||
padding: 0;
|
||||
}
|
||||
|
||||
html,
|
||||
body {
|
||||
overflow-x: hidden;
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
|
||||
background-color: var(--bg-page);
|
||||
|
|
@ -45,6 +51,10 @@ code {
|
|||
.app-header {
|
||||
background: var(--bg-card);
|
||||
border-bottom: 1px solid var(--border);
|
||||
width: 100%;
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 100;
|
||||
}
|
||||
|
||||
.header-container {
|
||||
|
|
@ -54,28 +64,33 @@ code {
|
|||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 16px;
|
||||
}
|
||||
|
||||
.brand-link {
|
||||
text-decoration: none;
|
||||
color: inherit;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.brand-name {
|
||||
font-size: 1.15rem;
|
||||
font-weight: 700;
|
||||
color: var(--text-main);
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.user-nav {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.user-id {
|
||||
font-size: 0.85rem;
|
||||
color: var(--text-muted);
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
/* ---------------- Main Layout ---------------- */
|
||||
|
|
@ -746,11 +761,22 @@ code {
|
|||
display: flex;
|
||||
align-items: center;
|
||||
gap: 20px;
|
||||
min-width: 0;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.main-nav {
|
||||
display: flex;
|
||||
gap: 6px;
|
||||
overflow-x: auto;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
scrollbar-width: none;
|
||||
min-width: 0;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.main-nav::-webkit-scrollbar {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.nav-item {
|
||||
|
|
@ -761,6 +787,8 @@ code {
|
|||
padding: 4px 10px;
|
||||
border-radius: var(--radius);
|
||||
transition: all 0.15s ease;
|
||||
flex-shrink: 0;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.nav-item:hover {
|
||||
|
|
@ -2139,6 +2167,65 @@ code {
|
|||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.header-container {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 8px 14px 6px;
|
||||
gap: 8px 0;
|
||||
}
|
||||
|
||||
.brand-group {
|
||||
display: contents;
|
||||
}
|
||||
|
||||
.brand-link {
|
||||
order: 1;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.user-nav {
|
||||
order: 2;
|
||||
flex-shrink: 0;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.user-id {
|
||||
font-size: 0.775rem;
|
||||
}
|
||||
|
||||
.main-nav {
|
||||
order: 3;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
gap: 6px;
|
||||
overflow-x: auto;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
scrollbar-width: none;
|
||||
padding: 4px 0 4px 0;
|
||||
margin: 0 -14px;
|
||||
padding-left: 14px;
|
||||
padding-right: 14px;
|
||||
}
|
||||
|
||||
.main-nav::-webkit-scrollbar {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.nav-item {
|
||||
font-size: 0.8rem;
|
||||
padding: 5px 12px;
|
||||
background: #f8fafc;
|
||||
border: 1px solid var(--border);
|
||||
}
|
||||
|
||||
.nav-item.active {
|
||||
background: var(--primary);
|
||||
border-color: var(--primary);
|
||||
color: white;
|
||||
}
|
||||
|
||||
.exam-cards-strip {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue