Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix rich text + Re-factor layout max width as a mixin #390

Merged
merged 2 commits into from
Dec 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.event-description {
// @todo use @include layout-container instead here.
padding: $s-md;
max-width: $layout__max-width;
margin: 0 auto;
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
2 changes: 1 addition & 1 deletion src/stories/Library/rich-text/rich-text.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
@include typography($typo__rich-text-body);

// Setting a max-width to increase readability for sentences.
max-width: $layout__max-width--text;
@include layout-container($layout__max-width--text);

a {
@extend %text-inline-link;
Expand Down
2 changes: 1 addition & 1 deletion src/styles/scss/tools.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@import "tools/variables.fonts";
@import "tools/variables.z-indexes";
@import "tools/variables.layout";
@import "tools/variables.spacings";
@import "tools/variables.layout";
@import "tools/variables.colors";
@import "tools/variables.breakpoints";
@import "tools/variables.typography";
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;
}
4 changes: 4 additions & 0 deletions src/styles/scss/tools/variables.layout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,7 @@ $layout__max-width--large: 1440px;
$layout__max-width--text: 780px;
$layout__max-width--single-media: 896px;
$layout__max-width--multiple-medias: 1240px;

// Some elements should not go out to the edge of the screen on small screens.
// This is the padding that is always shown on the left and right.
$layout__page-padding: $s-xl;
Loading