Skip to content

Commit df31be4

Browse files
committed
Fix mobile tab navigation overflow
- Add horizontal scrolling for Principles and Values tab navigation - Contain tabs within full-width on mobile with scroll access - Add scrollbar-hide utility class for clean mobile experience - Maintain centered layout on desktop while enabling scroll on mobile - Ensure all tabs are accessible via horizontal scrolling
1 parent e2c8722 commit df31be4

File tree

2 files changed

+27
-14
lines changed

2 files changed

+27
-14
lines changed

src/app/globals.css

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,15 @@
88
perspective: 1000px;
99
}
1010

11+
/* Hide scrollbar but keep functionality */
12+
.scrollbar-hide {
13+
-ms-overflow-style: none; /* Internet Explorer 10+ */
14+
scrollbar-width: none; /* Firefox */
15+
}
16+
.scrollbar-hide::-webkit-scrollbar {
17+
display: none; /* Safari and Chrome */
18+
}
19+
1120
:root {
1221
/* Dark theme with blue accent */
1322
--background: 0 0% 3%;

src/components/PrinciplesValuesShowcase.tsx

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -351,13 +351,14 @@ const PrinciplesValuesShowcase = () => {
351351
</div>
352352

353353
{/* Principle Navigation */}
354-
<div className="flex justify-center mb-12">
355-
<div
356-
ref={principlesNavRef}
357-
className="flex gap-2 bg-muted/30 p-2 rounded-xl"
358-
onMouseEnter={() => setIsHovered(true)}
359-
onMouseLeave={() => setIsHovered(false)}
360-
>
354+
<div className="mb-12 px-4">
355+
<div className="overflow-x-auto scrollbar-hide">
356+
<div
357+
ref={principlesNavRef}
358+
className="flex gap-2 bg-muted/30 p-2 rounded-xl w-fit mx-auto min-w-full justify-center md:w-fit md:min-w-0"
359+
onMouseEnter={() => setIsHovered(true)}
360+
onMouseLeave={() => setIsHovered(false)}
361+
>
361362
{translatedPrinciples.map((principle, index) => (
362363
<button
363364
key={principle.id}
@@ -371,6 +372,7 @@ const PrinciplesValuesShowcase = () => {
371372
{principle.shortTitle}
372373
</button>
373374
))}
375+
</div>
374376
</div>
375377
</div>
376378

@@ -459,13 +461,14 @@ const PrinciplesValuesShowcase = () => {
459461
</div>
460462

461463
{/* Value Navigation */}
462-
<div className="flex justify-center mb-12">
463-
<div
464-
ref={valuesNavRef}
465-
className="flex gap-2 bg-muted/30 p-2 rounded-xl"
466-
onMouseEnter={() => setIsHovered(true)}
467-
onMouseLeave={() => setIsHovered(false)}
468-
>
464+
<div className="mb-12 px-4">
465+
<div className="overflow-x-auto scrollbar-hide">
466+
<div
467+
ref={valuesNavRef}
468+
className="flex gap-2 bg-muted/30 p-2 rounded-xl w-fit mx-auto min-w-full justify-center md:w-fit md:min-w-0"
469+
onMouseEnter={() => setIsHovered(true)}
470+
onMouseLeave={() => setIsHovered(false)}
471+
>
469472
{translatedValues.map((value, index) => (
470473
<button
471474
key={value.id}
@@ -479,6 +482,7 @@ const PrinciplesValuesShowcase = () => {
479482
{value.shortTitle}
480483
</button>
481484
))}
485+
</div>
482486
</div>
483487
</div>
484488

0 commit comments

Comments
 (0)