Skip to content

Commit

Permalink
Add a layout-container mixin, and replace any existing max-widths.
Browse files Browse the repository at this point in the history
  • Loading branch information
rasben committed Dec 15, 2023
1 parent dd485fb commit 07bcb85
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 21 deletions.
9 changes: 5 additions & 4 deletions src/stories/Library/event-description/event-description.scss
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
.event-description {
padding: $s-md;
max-width: $layout__max-width;
margin: 0 auto;
@include layout-container;
padding-top: $s-md;
padding-bottom: $s-md;

@include media-query__small {
padding: $s-xl $s-4xl;
padding-top: $s-xl;
padding-bottom: $s-xl;
display: grid;
column-gap: $s-xl;
grid-template-columns: 2fr 1fr;
Expand Down
1 change: 1 addition & 0 deletions src/stories/Library/event-header/event-header.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.event-header {
// @todo use @include layout-container instead here.
max-width: $layout__max-width;
margin: 0 auto;

Expand Down
7 changes: 3 additions & 4 deletions src/stories/Library/link-with-icon/link-with-icon.scss
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
.link-with-icon {
@include typography($typo__body-placeholder);
@include show-svg-on-hover();
@include layout-container;

background-color: $color__global-primary;
padding: $s-md $s-lg;
padding-top: $s-md;
padding-bottom: $s-md;
display: grid;
grid-template-columns: 40px auto max-content;
align-items: center;
gap: $s-md;
text-decoration: none;
border: 1px solid $color__global-tertiary-1;
width: 100%;
max-width: $layout__max-width;
margin-left: auto;
margin-right: auto;

&:first-child {
margin-top: 0;
Expand Down
11 changes: 2 additions & 9 deletions src/stories/Library/medias/medias.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,7 @@ $_medias-breakpoint: 550px;
}

.medias--single {
max-width: $layout__max-width--single-media;
margin: auto;

.medias__item {
padding: 0 $s-md;
}
@include layout-container($layout__max-width--single-media, 0);
}

@include media-query($_medias-breakpoint) {
Expand Down Expand Up @@ -55,9 +50,7 @@ $_medias-breakpoint: 550px;
}

.medias--multiple {
max-width: $layout__max-width--multiple-medias;
//max-width: 900px;
margin: auto;
@include layout-container($layout__max-width--multiple-medias, 0);

.medias__item--last {
img {
Expand Down
5 changes: 1 addition & 4 deletions src/stories/Library/rich-text/rich-text.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@
@include typography($typo__rich-text-body);

// Setting a max-width to increase readability for sentences.
max-width: $layout__max-width--text;
margin: auto;
padding-left: $layout__page-padding;
padding-right: $layout__page-padding;
@include layout-container($layout__max-width--text);

a {
@extend %text-inline-link;
Expand Down
11 changes: 11 additions & 0 deletions src/styles/scss/tools/mixins.misc.scss
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,14 @@
opacity: 1;
}
}

@mixin layout-container(
$max-width: $layout__max-width,
$padding: $layout__page-padding
) {
max-width: $max-width;
margin: auto;
padding-left: $padding;
padding-right: $padding;
box-sizing: border-box;
}

0 comments on commit 07bcb85

Please sign in to comment.