Skip to content

Commit

Permalink
fix: Sass nested rule deprecation warnings by moving CSS parts
Browse files Browse the repository at this point in the history
fix all of the following warnings when building (i.e. "yarn build"):
```
Deprecation Warning: Sass's behavior for declarations that appear after
nested rules will be changing to match the behavior specified by CSS in
an upcoming version. To keep the existing behavior, move the declaration
above the nested rule. To opt into the new behavior, wrap the
declaration in `& {}`.

More info: https://sass-lang.com/d/mixed-decls
```
by moving CSS parts around, I checked that there were no dependencies
between the moved CSS parts that would make the end result functionally
different if they were moved.

refs KK-1372
  • Loading branch information
karisal-anders committed Dec 17, 2024
1 parent bef6e02 commit ac2529e
Show file tree
Hide file tree
Showing 12 changed files with 35 additions and 38 deletions.
3 changes: 1 addition & 2 deletions src/domain/app/layout/listPageLayout.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ $backButtonAsideBreakpoint: $backButtonWidth + variables.$breakpoint-xl;
'content content'
'actions actions';
row-gap: variables.$spacing-layout-xs;
margin-top: variables.$spacing-layout-s;
align-items: center;

@include layout.respond-above(m) {
Expand Down Expand Up @@ -71,8 +72,6 @@ $backButtonAsideBreakpoint: $backButtonWidth + variables.$breakpoint-xl;
grid-area: actions;
}

margin-top: variables.$spacing-layout-s;

// Remove margin from text elements so that we can control them with
// gaps.
& * {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,10 @@
@use '~styles/variables';

.infoPageLayout {
@include layout.respond-below(l) {
margin: 0 variables.$baseMargin variables.$largeMargin variables.$baseMargin;
}

display: flex;
flex-direction: column;
align-items: center;
justify-content: center;

color: variables.$color-black-90;

.infoPageLayoutFace {
Expand All @@ -31,6 +26,10 @@
font-size: variables.$fontsize-body-l;
text-align: center;
}

@include layout.respond-below(l) {
margin: 0 variables.$baseMargin variables.$largeMargin variables.$baseMargin;
}
}

.callToActionButton {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@
@use '~styles/variables';

.simpleFormPageLayout {
@include layout.respond-below(l) {
margin: 0 variables.$baseMargin variables.$largeMargin variables.$baseMargin;
}

display: flex;
flex-direction: column;
align-items: center;
Expand Down Expand Up @@ -36,4 +32,8 @@
width: min-content;
max-width: variables.$container-width-s;
}

@include layout.respond-below(l) {
margin: 0 variables.$baseMargin variables.$largeMargin variables.$baseMargin;
}
}
10 changes: 5 additions & 5 deletions src/domain/app/notFound/notFound.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@
align-self: center;

.returnLink {
width: 50%;
@include layout.respond-below(m) {
width: 80%;
}

display: block;
margin: variables.$largeMargin auto auto auto;
background: variables.$color-summer;
box-sizing: border-box;
text-decoration: none;
padding: variables.$basePadding;
color: variables.$color-black;

width: 50%;
@include layout.respond-below(m) {
width: 80%;
}
}
}

Expand Down
7 changes: 4 additions & 3 deletions src/domain/event/event.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -80,18 +80,18 @@
}

.eventWrapper {
display: grid;
@include layout.respond-above(l) {
z-index: 1;
}
display: grid;
.event {
background-color: var(--color-white);
@include layout.respond-above(l) {
padding: variables.$largePadding;
h1 {
margin-top: 0;
}
}
background-color: var(--color-white);
}
@include layout.respond-below(l) {
padding: 0 variables.$basePadding;
Expand All @@ -111,12 +111,13 @@
background: variables.$color-fog-medium-light;
box-sizing: border-box;
padding: variables.$spacing-2-xs;
display: block;

width: 100%;
@include layout.respond-above(l) {
width: auto;
}
display: block;

.label {
display: inline-flex;
width: min-content;
Expand Down
2 changes: 1 addition & 1 deletion src/domain/home/form/homePreliminaryForm.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@
}

.submitButton {
justify-self: center;
width: 80%;
@include layout.respond-above(m) {
width: 60%;
}
justify-self: center;
}

.heading {
Expand Down
8 changes: 4 additions & 4 deletions src/domain/home/hero/hero.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@

.kidsImage {
grid-column: 2;
min-height: calc(0.265 * 100vw);
@media (min-width: map.get(layout.$breakpoints, xl-minus)) {
min-height: 0.265 * variables.$containerMaxWidth;
}
background-image: url('/images/[email protected]');
background-repeat: no-repeat;
background-position: center bottom -2px;
background-size: 100% auto;
min-height: calc(0.265 * 100vw);
@media (min-width: map.get(layout.$breakpoints, xl-minus)) {
min-height: 0.265 * variables.$containerMaxWidth;
}
}

.heroContainer {
Expand Down
2 changes: 1 addition & 1 deletion src/domain/home/partners/partnerLogoList.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

.big {
display: grid;
margin-bottom: variables.$largeMargin;
@include layout.respond-below(l) {
justify-content: center;
gap: 2em;
Expand All @@ -11,7 +12,6 @@
grid-template-columns: repeat(2, 1fr);
gap: variables.$xlargeMargin;
}
margin-bottom: variables.$largeMargin;

.container {
@include layout.respond-above(m) {
Expand Down
12 changes: 5 additions & 7 deletions src/domain/profile/modal/editProfileModal.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -35,30 +35,28 @@

.buttonsWrapper {
display: grid;
@include layout.respond-above(m) {
grid-template-columns: 1fr 1fr;
}
grid-gap: variables.$baseMargin;
margin: variables.$largeMargin 0;
button: {
width: 100%;
}
@include layout.respond-above(m) {
grid-template-columns: 1fr 1fr;
}
}

.cancelButton {
width: 100%;
@include layout.respond-below(m) {
grid-row: 2;
}

width: 100%;
}

.submitButton {
width: 100%;
@include layout.respond-below(m) {
grid-row: 1;
}

width: 100%;
}

.profileName {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ $childIconHeight: 4rem;

.childName,
.childFixedInfo {
padding: variables.$baseMargin 0;
@include layout.respond-above(l) {
display: grid;
grid-template-columns: 1fr 1fr;
grid-gap: variables.$baseMargin;
}
padding: variables.$baseMargin 0;
}

.childBirthyear,
Expand Down
2 changes: 1 addition & 1 deletion src/domain/registration/form/registrationForm.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ $plusIconHeight: 2rem;
}

.registrationGrayContainer {
margin: variables.$baseMargin;
> * {
grid-column: 2;
}
margin: variables.$baseMargin;
}

.guardianInfo {
Expand Down
8 changes: 4 additions & 4 deletions src/domain/registration/notEligible/notEligible.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
@use '~styles/variables';

.notEligible {
@include layout.respond-below(l) {
margin: 0 variables.$baseMargin variables.$largeMargin variables.$baseMargin;
}

font-weight: bold;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;

@include layout.respond-below(l) {
margin: 0 variables.$baseMargin variables.$largeMargin variables.$baseMargin;
}

.notEligibleFace {
height: 4rem;
width: 4rem;
Expand Down

0 comments on commit ac2529e

Please sign in to comment.