Skip to content

Commit f50c571

Browse files
stevesCopilot
andauthored
Prevent horizontal scrolling on small view ports (#61496)
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent a31a519 commit f50c571

2 files changed

Lines changed: 16 additions & 5 deletions

File tree

src/landings/components/CookBookArticleCard.module.scss

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,19 @@
88

99
.cardContainer {
1010
min-height: 200px;
11+
overflow-wrap: break-word;
12+
word-break: break-word;
1113
}
1214

1315
.label {
14-
margin-right: 0.25rem;
16+
white-space: normal !important;
17+
overflow: visible !important;
18+
text-overflow: unset !important;
19+
height: auto !important;
20+
line-height: 1.4 !important;
21+
}
22+
23+
.labelGroup {
24+
flex-wrap: wrap;
25+
gap: 0.25rem;
1526
}

src/landings/components/CookBookArticleCard.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,23 +34,23 @@ export const CookBookArticleCard = ({
3434
return (
3535
<div className="m-2">
3636
<div
37-
className={`${styles.cardContainer} ${spotlight ? spotlightClasses : 'd-flex pb-3 border-bottom'}`}
37+
className={`${styles.cardContainer} ${spotlight ? spotlightClasses : 'd-flex flex-wrap pb-3 border-bottom'}`}
3838
>
3939
{spotlight ? setImage(image, title) : null}
4040
{spotlight
4141
? null
4242
: IconComponent && (
4343
<IconComponent
4444
size={48}
45-
className="mr-4 bgColor-accent-muted p-3 circle fgColor-accent"
45+
className="mr-4 bgColor-accent-muted p-3 circle fgColor-accent flex-shrink-0"
4646
/>
4747
)}
48-
<div>
48+
<div className="min-width-0 flex-1">
4949
<h3 className="h4 fgColor-accent">
5050
<Link href={url}>{title}</Link>
5151
</h3>
5252
<div className="fgColor-muted mb-3 mt-2">{description}</div>
53-
<LabelGroup>
53+
<LabelGroup className={styles.labelGroup}>
5454
{tags.map((tag, index) => (
5555
<Label key={index} variant="accent" className={styles.label} size="small">
5656
{tag}

0 commit comments

Comments
 (0)