Skip to content

Commit b156d96

Browse files
committed
fix: update minor style improvements for best of core x section
1 parent 0b0a19f commit b156d96

File tree

3 files changed

+26
-8
lines changed

3 files changed

+26
-8
lines changed

src/components/BestOfCoreX/BestOfCoreX.jsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ export default function BestOfCoreX() {
9898
}
9999

100100
return (
101-
<section className="max-w-7xl mx-auto flex flex-col gap-[40px]">
101+
<section className="px-10 w-full max-w-7xl mx-auto flex flex-col gap-[40px]">
102102
{/* Header */}
103103
<h2 className="bg-[#F7FAFF] text-[32px] lg:text-[48px] uppercase section-title">
104104
<span className="text-[#000]">BEST </span>
@@ -109,14 +109,14 @@ export default function BestOfCoreX() {
109109
</h2>
110110

111111
{/* Tabs + Navigation in same row */}
112-
<div className="flex flex-wrap justify-between items-center mb-6 gap-4">
113-
{/* Tabs */}
114-
<div className="flex flex-wrap gap-3">
112+
<div className="flex flex-wrap justify-between items-center sm:gap-4">
113+
{/* Tabs: horizontally scrollable on mobile, hidden scrollbar */}
114+
<div className="tabs-scroll-container px-4 sm:mx-0 sm:px-0 overflow-x-auto whitespace-nowrap snap-x snap-mandatory sm:overflow-visible">
115115
{tabs.map((tab) => (
116116
<button
117117
key={tab.id}
118118
onClick={() => setActiveTab(tab.id)}
119-
className={`px-5 py-2 rounded-lg font-semibold uppercase tracking-wide transition-all duration-300
119+
className={`inline-block mr-3 last:mr-0 snap-start px-5 py-2 rounded-lg font-semibold uppercase tracking-wide transition-all duration-300
120120
${
121121
activeTab === tab.id
122122
? 'bg-[#171717] text-white'
@@ -130,7 +130,7 @@ export default function BestOfCoreX() {
130130

131131
{/* Navigation Buttons (inline beside tabs) */}
132132
{products.length > itemsPerPage && (
133-
<div className="flex items-center gap-3 ml-auto">
133+
<div className="hidden sm:flex items-center gap-3 ml-auto">
134134
<button
135135
onClick={prevSlide}
136136
disabled={!canGoPrev}

src/components/Header/MobileMenu.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ const MobileMenu = ({
127127
<User className="h-5 w-5" />
128128
<span>Account</span>
129129
</button>
130-
<button
130+
<div
131131
className="flex items-center space-x-2 text-gray-700 hover:text-black cursor-pointer"
132132
onClick={() => {
133133
handleCloseMenu();
@@ -136,7 +136,7 @@ const MobileMenu = ({
136136
>
137137
<CartIcon />
138138
<span>Cart</span>
139-
</button>
139+
</div>
140140
</div>
141141
</div>
142142
</div>

src/index.css

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,4 +283,22 @@ body {
283283
background-color: var(--color-white-back);
284284
color: var(--color-black);
285285
overflow-x: hidden;
286+
}
287+
288+
/* hide native scrollbars but keep scrolling functional */
289+
.tabs-scroll-container {
290+
-ms-overflow-style: none;
291+
/* IE and Edge */
292+
scrollbar-width: none;
293+
/* Firefox */
294+
}
295+
296+
.tabs-scroll-container::-webkit-scrollbar {
297+
display: none;
298+
/* Chrome, Safari */
299+
}
300+
301+
/* optional: smoother snap start alignment */
302+
.tabs-scroll-container>button {
303+
scroll-snap-align: start;
286304
}

0 commit comments

Comments
 (0)