Skip to content

Commit d888cad

Browse files
authored
[BE][HUD] Enhance navbar responsiveness (#6944)
### Summary Made navbar responsive to prevent content cutoff at typical laptop resolutions (~1300-1400px) --- # Before: laptop screen: <img width="1416" height="132" alt="image" src="https://github.com/user-attachments/assets/cf1ee8b3-0b97-41b1-af3d-dbb51bb6ae34" /> shrunk screen: <img width="794" height="206" alt="image" src="https://github.com/user-attachments/assets/23d658c8-440e-4a3d-b71b-43f7466d964a" /> mobile: <img width="460" height="432" alt="image" src="https://github.com/user-attachments/assets/75bfa2a8-4c59-4b50-a6d9-b7e71a0153e1" /> # After: laptop screen: <img width="1414" height="169" alt="image" src="https://github.com/user-attachments/assets/b4050b06-dccb-482a-9a00-a54c715e246d" /> shrunk screen: <img width="794" height="182" alt="image" src="https://github.com/user-attachments/assets/8d372c19-e33b-472f-9a87-dd99a7dcbd58" /> mobile: <img width="407" height="414" alt="image" src="https://github.com/user-attachments/assets/38f402ad-e53b-42b2-9af5-e23c7b60aab7" />
1 parent 910e585 commit d888cad

File tree

2 files changed

+23
-4
lines changed

2 files changed

+23
-4
lines changed

torchci/components/layout/NavBar.module.css

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.navbar {
22
display: flex;
3-
padding: 0 1rem;
3+
padding: 0 clamp(0.5rem, 1vw, 1rem);
44
font: bold;
55
background: var(--navbar-bg);
66
box-shadow: var(--navbar-shadow);
@@ -11,10 +11,13 @@
1111
z-index: 1000;
1212
backdrop-filter: blur(1px);
1313
-webkit-backdrop-filter: blur(1px);
14+
flex-wrap: wrap;
15+
gap: clamp(0.5rem, 2vw, 1.5rem);
16+
font-size: clamp(14px, 1vw, 16px);
1417
}
1518

1619
.navbar li {
17-
padding: 0.9rem 1rem;
20+
padding: clamp(0.5rem, 0.8vw, 0.7rem) clamp(0.6rem, 1vw, 0.8rem);
1821
position: relative;
1922
display: flex;
2023
align-items: center;
@@ -53,7 +56,7 @@
5356
}
5457

5558
.dropdowntitle {
56-
padding: 0.7rem 1rem;
59+
padding: clamp(0.4rem, 0.8vw, 0.6rem) clamp(0.6rem, 1vw, 0.8rem);
5760
cursor: pointer;
5861
display: flex;
5962
align-items: center;
@@ -71,3 +74,19 @@
7174
display: none;
7275
border-radius: 4px;
7376
}
77+
78+
/* Responsive wrapping */
79+
@media screen and (max-width: 1350px) {
80+
.navbar > div:first-child {
81+
width: 100%;
82+
margin-bottom: 0.5rem;
83+
}
84+
85+
.navbar > div:last-child {
86+
width: 100%;
87+
}
88+
89+
.navbarlinkslist {
90+
flex-wrap: wrap;
91+
}
92+
}

torchci/components/layout/NavBar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ function NavBar() {
291291
<li>
292292
<ThemeModePicker />
293293
</li>
294-
<li style={{ padding: "0 1rem" }}>
294+
<li>
295295
<LoginSection></LoginSection>
296296
</li>
297297
</ul>

0 commit comments

Comments
 (0)