Skip to content

Commit

Permalink
Merge pull request #911 from City-of-Helsinki/UHF-5532_column_gap_fixes
Browse files Browse the repository at this point in the history
UHF-5532: Fixes issue with 4 cards not fitting side by side on the contact card listing
  • Loading branch information
teroelonen authored Feb 27, 2024
2 parents d33cb4e + 4b83259 commit 089d841
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 5 deletions.
2 changes: 1 addition & 1 deletion dist/css/styles.min.css

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 15 additions & 1 deletion src/scss/06_components/paragraphs/_contact-card-listing.scss
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,21 @@ $contact-card-bp: calc(($contact-card-max-width * 2) + ($component-side-padding-
@include breakpoint($breakpoint-s) {
max-width: none;
min-width: min-content;
width: 25%;
// Substract the gaps between the cards so that exactly 4 cards fit side by side.
width: calc(25% - ($contact-card-gap * 0.75));
}
}
}

// The components upper region has a max-width limitation that makes it impossible to include
// four 200px (contact card min-width) wide elements with 24px gap on same row so we need to adjust
// the column gap on the listing when displayed on region.
.components--upper .contact-card-listing--container {
column-gap: calc($contact-card-gap - $spacing-quarter);

.contact-card {
@include breakpoint($breakpoint-s) {
width: calc(25% - (($contact-card-gap - $spacing-quarter) * 0.75));
}
}
}

0 comments on commit 089d841

Please sign in to comment.