Skip to content

Commit 780e1ac

Browse files
Improve responsive styling for integration category chips
- Invert chip styling: active chips now use light bg with border, inactive chips use dark filled bg (fixes #7593) - Replace react-slick slider with responsive flexbox/scroll layout - Add proper button elements with data-category attrs for robust filtering - Add ARIA attributes (role, aria-pressed, aria-label) for accessibility - Add focus-visible ring, reduced-motion support - Add mobile horizontal scroll with snap and overflow fade indicator - Add smooth hover/active transitions with Keppel theme colors - Touch-friendly sizing on mobile with no clipping or overflow issues - Full dark mode support using existing theme tokens
1 parent 4304b03 commit 780e1ac

2 files changed

Lines changed: 189 additions & 137 deletions

File tree

src/sections/Meshery/Meshery-integrations/Integration.style.js

Lines changed: 152 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import styled from "styled-components";
2-
import Slider from "react-slick";
32

43
export const HoneycombGrid = styled.div`
54
.heading {
@@ -15,16 +14,16 @@ export const HoneycombGrid = styled.div`
1514
}
1615
1716
.search-box {
18-
input {
19-
border: 1px solid ${props => props.theme.headingColor} !important;
20-
21-
&:focus {
22-
border-color: #fff !important;
23-
box-shadow: rgba(100, 100, 111, 0.2) 0px 7px 29px 0px !important;
24-
}
17+
input {
18+
border: 1px solid ${(props) => props.theme.headingColor} !important;
19+
20+
&:focus {
21+
border-color: #fff !important;
22+
box-shadow: rgba(100, 100, 111, 0.2) 0px 7px 29px 0px !important;
23+
}
2524
}
2625
}
27-
26+
2827
.category {
2928
display: flex;
3029
flex-wrap: wrap;
@@ -33,27 +32,6 @@ export const HoneycombGrid = styled.div`
3332
justify-content: center;
3433
}
3534
36-
.items {
37-
background-color: #D2D8DA; //#E7EFF3;
38-
padding: 0.625rem 1.5625rem;
39-
border-radius: 0.625rem;
40-
text-transform: uppercase;
41-
color: #1e2117;
42-
font-size: 0.875rem;
43-
cursor: pointer;
44-
transition: all .1s ease-in-out;
45-
46-
&:hover {
47-
opacity: 0.8;
48-
box-shadow: 0px 0px 6px -2px rgb(60, 73, 79);
49-
}
50-
}
51-
52-
.selected {
53-
background-color: ${(props) => props.theme.darkJungleGreenColor};
54-
color: ${(props) => props.theme.white};
55-
}
56-
5735
ul {
5836
margin: 2.5rem 0 0 0;
5937
padding-left: 50px;
@@ -109,7 +87,7 @@ export const HoneycombGrid = styled.div`
10987
opacity: 0;
11088
font-weight: 600;
11189
transition: 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
112-
padding:10px;
90+
padding: 10px;
11391
}
11492
.learnMoreBtn {
11593
padding: 5px 10px;
@@ -174,7 +152,7 @@ export const IntegrationsWrapper = styled.div`
174152
min-height: 300px; /* Add explicit min-height */
175153
position: relative; /* Add position for better layout control */
176154
width: 100%; /* Add explicit width */
177-
155+
178156
.seeAllBtn {
179157
&:hover {
180158
color: white;
@@ -219,69 +197,162 @@ export const IntegrationCard = styled.div`
219197
// }
220198
`;
221199

222-
export const IntegrationSlider = styled(Slider)`
223-
.slick-prev:hover, .slick-next:hover{
224-
box-shadow: none;
225-
outline:none;
226-
}
200+
export const CategoryFilterBar = styled.div`
201+
position: relative;
202+
margin: 1.5rem 0 2rem;
203+
padding: 0 0.5rem;
227204
228-
.slick-arrow {
229-
width: 2rem;
230-
height: 3rem;
231-
}
205+
.category-chips-wrapper {
206+
display: flex;
207+
flex-wrap: wrap;
208+
justify-content: center;
209+
gap: 0.5rem;
210+
padding: 0.25rem 0;
211+
212+
@media screen and (max-width: 768px) {
213+
flex-wrap: nowrap;
214+
overflow-x: auto;
215+
justify-content: flex-start;
216+
scroll-behavior: smooth;
217+
-webkit-overflow-scrolling: touch;
218+
scroll-snap-type: x proximity;
219+
padding: 0.5rem 0.25rem;
220+
margin: 0 -0.5rem;
221+
padding-left: 0.5rem;
222+
padding-right: 0.5rem;
232223
233-
.slick-list {
234-
padding-top: 0.2rem;
224+
/* Hide scrollbar but keep functionality */
225+
scrollbar-width: none;
226+
-ms-overflow-style: none;
227+
&::-webkit-scrollbar {
228+
display: none;
229+
}
230+
}
235231
}
236232
237-
.slick-disabled {
233+
/* Overflow fade indicators for mobile scroll */
234+
&::after {
235+
content: "";
236+
position: absolute;
237+
top: 0;
238+
right: 0;
239+
bottom: 0;
240+
width: 2.5rem;
238241
pointer-events: none;
239-
opacity: 0.3;
240-
}
242+
opacity: 0;
243+
transition: opacity 0.3s ease;
241244
242-
.slick-arrow:before {
243-
color: ${(props) => props.theme.whiteToBlack};
244-
font-size: 4rem;
245-
display: inline-block;
246-
height: 1rem;
247-
-webkit-text-size-adjust: none;
248-
transition: 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
245+
@media screen and (max-width: 768px) {
246+
opacity: 1;
247+
background: linear-gradient(
248+
to right,
249+
transparent,
250+
${(props) =>
251+
props.theme.DarkTheme
252+
? "rgba(18,18,18,0.85)"
253+
: "rgba(255,255,255,0.85)"}
254+
);
255+
}
249256
}
250257
251-
.slick-arrow:hover:before {
252-
color: #00b39f;
253-
}
258+
.category-chip {
259+
/* ── Inactive (default) = dark / filled ── */
260+
display: inline-flex;
261+
align-items: center;
262+
gap: 0.375rem;
263+
padding: 0.5rem 1.125rem;
264+
border-radius: 2rem;
265+
font-size: 0.8125rem;
266+
font-weight: 600;
267+
letter-spacing: 0.025em;
268+
text-transform: uppercase;
269+
white-space: nowrap;
270+
cursor: pointer;
271+
user-select: none;
272+
border: 1.5px solid transparent;
273+
outline: none;
274+
scroll-snap-align: start;
254275
255-
.slick-slide {
256-
width: auto !important;
257-
margin: 0 .5rem;
258-
}
276+
background: ${(props) =>
277+
props.theme.DarkTheme
278+
? "rgba(255,255,255,0.08)"
279+
: props.theme.darkJungleGreenColor};
280+
color: ${(props) =>
281+
props.theme.DarkTheme ? "rgba(255,255,255,0.7)" : "#ffffff"};
259282
260-
.slick-next{
261-
right: -2.5rem;
262-
}
283+
transition:
284+
background 0.25s ease,
285+
color 0.25s ease,
286+
border-color 0.25s ease,
287+
box-shadow 0.25s ease,
288+
transform 0.15s ease;
263289
264-
.slick-prev{
265-
left: -2.5rem;
266-
}
290+
&:hover {
291+
background: ${(props) =>
292+
props.theme.DarkTheme ? "rgba(255,255,255,0.14)" : "#2d3328"};
293+
transform: translateY(-1px);
294+
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
295+
}
267296
268-
.slick-prev:before {
269-
content:"‹";
270-
line-height: 0;
271-
opacity: 1;
272-
}
297+
&:focus-visible {
298+
border-color: ${(props) => props.theme.keppelColor};
299+
box-shadow: 0 0 0 3px
300+
${(props) =>
301+
props.theme.DarkTheme
302+
? "rgba(0,211,169,0.35)"
303+
: "rgba(0,179,159,0.3)"};
304+
}
273305
274-
.slick-track {
275-
display: flex;
276-
}
306+
&:active {
307+
transform: scale(0.97);
308+
}
309+
310+
/* ── Active / Selected = light / outlined ── */
311+
&.selected {
312+
background: ${(props) =>
313+
props.theme.DarkTheme ? "rgba(0,211,169,0.15)" : "#f0fdfb"};
314+
color: ${(props) =>
315+
props.theme.DarkTheme
316+
? props.theme.keppelColor
317+
: props.theme.secondaryColor};
318+
border-color: ${(props) =>
319+
props.theme.DarkTheme
320+
? props.theme.keppelColor
321+
: props.theme.secondaryColor};
322+
font-weight: 700;
323+
324+
&:hover {
325+
background: ${(props) =>
326+
props.theme.DarkTheme ? "rgba(0,211,169,0.22)" : "#e0f9f5"};
327+
box-shadow: 0 2px 12px
328+
${(props) =>
329+
props.theme.DarkTheme
330+
? "rgba(0,211,169,0.2)"
331+
: "rgba(0,179,159,0.18)"};
332+
}
333+
}
277334
278-
.slick-next:before {
279-
content: "›";
280-
line-height: 0;
281-
opacity: 1;
335+
.chip-count {
336+
font-size: 0.6875rem;
337+
font-weight: 500;
338+
opacity: 0.7;
339+
margin-left: 0.125rem;
340+
}
341+
342+
/* Touch-friendly sizing on mobile */
343+
@media screen and (max-width: 768px) {
344+
padding: 0.5rem 1rem;
345+
font-size: 0.75rem;
346+
min-height: 2.25rem;
347+
}
282348
}
283349
284-
.slick-prev, .slick-next {
285-
top: 1.5rem;
350+
@media (prefers-reduced-motion: reduce) {
351+
.category-chip {
352+
transition: none;
353+
}
354+
.category-chips-wrapper {
355+
scroll-behavior: auto;
356+
}
286357
}
287-
`;
358+
`;

0 commit comments

Comments
 (0)