Skip to content

Commit

Permalink
UHF-9132: Convert content cards gray version to use component--full-w…
Browse files Browse the repository at this point in the history
…idth class
  • Loading branch information
teroelonen committed Nov 23, 2023
1 parent 4e8bfd3 commit 063e1f2
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 8 deletions.
2 changes: 1 addition & 1 deletion dist/css/styles.min.css

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions src/scss/06_components/layout/_component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,16 @@
@include component-side-padding;
}

.component--full-width {
padding-bottom: $spacing-triple;
padding-top: $spacing-triple;

@include breakpoint($breakpoint-m) {
padding-bottom: $spacing-quadruple;
padding-top: $spacing-quadruple;
}
}

.component__container {
margin-left: auto;
margin-right: auto;
Expand Down
17 changes: 12 additions & 5 deletions src/scss/06_components/paragraphs/_content-cards.scss
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ $-card-spacing: $spacing-and-half;
display: grid;
grid-template-columns: [full-width-start] $spacing [content-start] 1fr [content-end] $spacing [full-width-end] ;
grid-template-rows: [header-start] auto [header-end] auto;
padding-top: 0;

@include breakpoint($breakpoint-m) {
grid-template-columns: [full-width-start] $spacing-double [content-start] 1fr [content-end] $spacing-double [full-width-end] ;
Expand All @@ -143,12 +144,10 @@ $-card-spacing: $spacing-and-half;

.component__container {
grid-column: content;
padding-bottom: $spacing-quadruple;
padding-top: $spacing-triple;
padding-top: $spacing;

@include breakpoint($breakpoint-l) {
padding-bottom: $spacing-sextuple;
padding-top: $spacing-quadruple;
@include breakpoint($breakpoint-m) {
padding-top: $spacing-double;
}
}

Expand All @@ -158,6 +157,14 @@ $-card-spacing: $spacing-and-half;
}
}

// The koro is not visible on these occasions so the padding needs to be removed as well.
:not(.page-type--landing-page).wrapper .components--upper,
:not(.page-type--landing-page).wrapper .components:not(.components--lower) {
.component--content-cards-grey .component__container {
padding-top: 0;
}
}

.component--content-cards-small {
.content-card {
&:nth-child(-n+2) {
Expand Down
4 changes: 2 additions & 2 deletions templates/paragraphs/paragraph--content-cards.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
{% elseif design == 'large-cards' %}
{% set design_class = 'component--content-cards-large' %}
{% elseif design == 'small-cards-grey' %}
{% set design_class = 'component--content-cards-small component--content-cards-grey' %}
{% set design_class = 'component--full-width component--content-cards-small component--content-cards-grey' %}
{% set has_koro = true %}
{% elseif design == 'large-cards-grey' %}
{% set design_class = 'component--content-cards-large component--content-cards-grey' %}
{% set design_class = 'component--full-width component--content-cards-large component--content-cards-grey' %}
{% set has_koro = true %}
{% else %}
{% set design_class = null %} {# This should not happen #}
Expand Down

0 comments on commit 063e1f2

Please sign in to comment.