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

feat: Replace deprecated import statements in Sass with new API #1777

Merged
merged 7 commits into from
Dec 13, 2024
4 changes: 2 additions & 2 deletions packages/css/src/components/accordion/accordion.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
* Copyright Gemeente Amsterdam
*/

@import "../../common/text-rendering";
@use "../../common/text-rendering";

.ams-accordion {
display: flex;
flex-direction: column;
gap: var(--ams-accordion-gap);

@include text-rendering;
@include text-rendering.text-rendering;
VincentSmedinga marked this conversation as resolved.
Show resolved Hide resolved
}

.ams-accordion__header {
Expand Down
8 changes: 4 additions & 4 deletions packages/css/src/components/blockquote/blockquote.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
* Copyright Gemeente Amsterdam
*/

@import "../../common/hyphenation";
@import "../../common/text-rendering";
@use "../../common/hyphenation";
@use "../../common/text-rendering";

@mixin reset-blockquote {
margin-block: 0;
Expand All @@ -21,8 +21,8 @@
line-height: var(--ams-blockquote-line-height);
quotes: "“" "”";

@include hyphenation;
@include text-rendering;
@include hyphenation.hyphenation;
@include text-rendering.text-rendering;
@include reset-blockquote;

&::before {
Expand Down
4 changes: 2 additions & 2 deletions packages/css/src/components/breadcrumb/breadcrumb.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Copyright Gemeente Amsterdam
*/

@import "../../common/text-rendering";
@use "../../common/text-rendering";

@mixin reset-ol {
margin-block: 0;
Expand All @@ -22,7 +22,7 @@
break-after: avoid;
break-inside: avoid;

@include text-rendering;
@include text-rendering.text-rendering;
@include reset-ol;
}

Expand Down
60 changes: 30 additions & 30 deletions packages/css/src/components/breakout/breakout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,105 +3,105 @@
* Copyright Gemeente Amsterdam
*/

@import "../../common/breakpoint";
@import "../grid/grid";
@import "../grid/mixins";
@use "../../common/breakpoint";
@use "../grid/grid";
@use "../grid/mixins";

$ams-breakout-row-span-max: 4;

.ams-breakout {
@include ams-grid;
@include mixins.ams-grid;
VincentSmedinga marked this conversation as resolved.
Show resolved Hide resolved
}

// Grid gap

.ams-breakout--gap-vertical--none {
@include ams-grid--gap-vertical--none;
@include mixins.ams-grid--gap-vertical--none;
}

.ams-breakout--gap-vertical--small {
@include ams-grid--gap-vertical--small;
@include mixins.ams-grid--gap-vertical--small;
}

.ams-breakout--gap-vertical--large {
@include ams-grid--gap-vertical--large;
@include mixins.ams-grid--gap-vertical--large;
}

// Grid padding

.ams-breakout--padding-bottom--small {
@include ams-grid--padding-bottom--small;
@include mixins.ams-grid--padding-bottom--small;
}

.ams-breakout--padding-bottom--medium {
@include ams-grid--padding-bottom--medium;
@include mixins.ams-grid--padding-bottom--medium;
}

.ams-breakout--padding-bottom--large {
@include ams-grid--padding-bottom--large;
@include mixins.ams-grid--padding-bottom--large;
}

.ams-breakout--padding-top--small {
@include ams-grid--padding-top--small;
@include mixins.ams-grid--padding-top--small;
}

.ams-breakout--padding-top--medium {
@include ams-grid--padding-top--medium;
@include mixins.ams-grid--padding-top--medium;
}

.ams-breakout--padding-top--large {
@include ams-grid--padding-top--large;
@include mixins.ams-grid--padding-top--large;
}

.ams-breakout--padding-vertical--small {
@include ams-grid--padding-vertical--small;
@include mixins.ams-grid--padding-vertical--small;
}

.ams-breakout--padding-vertical--medium {
@include ams-grid--padding-vertical--medium;
@include mixins.ams-grid--padding-vertical--medium;
}

.ams-breakout--padding-vertical--large {
@include ams-grid--padding-vertical--large;
@include mixins.ams-grid--padding-vertical--large;
}

// Column span
// The order of these declaration blocks ensures the intended specificity.

.ams-breakout__cell--col-span-all {
@include ams-grid__cell--span-all;
@include mixins.ams-grid__cell--span-all;
}

@for $i from 1 through $ams-grid-column-count {
@for $i from 1 through grid.$ams-grid-column-count {
.ams-breakout__cell--col-span-#{$i} {
@include ams-grid__cell--span($i);
@include mixins.ams-grid__cell--span($i);
}

.ams-breakout__cell--col-start-#{$i} {
@include ams-grid__cell--start($i);
@include mixins.ams-grid__cell--start($i);
}
}

@media screen and (min-width: $ams-breakpoint-medium) {
@for $i from 1 through $ams-grid-column-count {
@media screen and (min-width: breakpoint.$ams-breakpoint-medium) {
VincentSmedinga marked this conversation as resolved.
Show resolved Hide resolved
@for $i from 1 through grid.$ams-grid-column-count {
.ams-breakout__cell--col-span-#{$i}-medium {
@include ams-grid__cell--span-medium($i);
@include mixins.ams-grid__cell--span-medium($i);
}

.ams-breakout__cell--col-start-#{$i}-medium {
@include ams-grid__cell--start-medium($i);
@include mixins.ams-grid__cell--start-medium($i);
}
}
}

@media screen and (min-width: $ams-breakpoint-wide) {
@for $i from 1 through $ams-grid-column-count {
@media screen and (min-width: breakpoint.$ams-breakpoint-wide) {
@for $i from 1 through grid.$ams-grid-column-count {
.ams-breakout__cell--col-span-#{$i}-wide {
@include ams-grid__cell--span-wide($i);
@include mixins.ams-grid__cell--span-wide($i);
}

.ams-breakout__cell--col-start-#{$i}-wide {
@include ams-grid__cell--start-wide($i);
@include mixins.ams-grid__cell--start-wide($i);
}
}
}
Expand Down Expand Up @@ -138,7 +138,7 @@ $ams-breakout-row-span-max: 4;
}
}

@media screen and (min-width: $ams-breakpoint-medium) {
@media screen and (min-width: breakpoint.$ams-breakpoint-medium) {
@for $i from 1 through $ams-breakout-row-span-max {
.ams-breakout__cell--row-span-#{$i}-medium {
grid-row-end: span $i;
Expand All @@ -150,7 +150,7 @@ $ams-breakout-row-span-max: 4;
}
}

@media screen and (min-width: $ams-breakpoint-wide) {
@media screen and (min-width: breakpoint.$ams-breakpoint-wide) {
@for $i from 1 through $ams-breakout-row-span-max {
.ams-breakout__cell--row-span-#{$i}-wide {
grid-row-end: span $i;
Expand Down
4 changes: 2 additions & 2 deletions packages/css/src/components/button/button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Copyright Gemeente Amsterdam
*/

@import "../../common/text-rendering";
@use "../../common/text-rendering";

@mixin reset-button {
border: 0;
Expand All @@ -26,7 +26,7 @@
padding-inline: var(--ams-button-padding-inline);
touch-action: manipulation;

@include text-rendering;
@include text-rendering.text-rendering;
@include reset-button;

&:disabled,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Copyright Gemeente Amsterdam
*/

@import "../../common/text-rendering";
@use "../../common/text-rendering";

.ams-character-count {
color: var(--ams-character-count-color);
Expand All @@ -12,7 +12,7 @@
font-weight: var(--ams-character-count-font-weight);
line-height: var(--ams-character-count-line-height);

@include text-rendering;
@include text-rendering.text-rendering;
}

.ams-character-count--error {
Expand Down
12 changes: 6 additions & 6 deletions packages/css/src/components/checkbox/checkbox.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
* Copyright Gemeente Amsterdam
*/

@import "../../common/input-label-focus";
@import "../../common/hide-input";
@import "../../common/text-rendering";
@use "../../common/input-label-focus";
@use "../../common/hide-input";
@use "../../common/text-rendering";

.ams-checkbox__input {
@include hide-input;
@include input-label-focus;
@include hide-input.hide-input;
@include input-label-focus.input-label-focus;
}

.ams-checkbox__checkmark {
Expand Down Expand Up @@ -44,7 +44,7 @@
line-height: var(--ams-checkbox-line-height);
outline-offset: var(--ams-checkbox-outline-offset);

@include text-rendering;
@include text-rendering.text-rendering;

&:hover {
color: var(--ams-checkbox-hover-color);
Expand Down
4 changes: 2 additions & 2 deletions packages/css/src/components/column/column.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
* Copyright Gemeente Amsterdam
*/

@import "../../common/size";
@use "../../common/size";

.ams-column {
display: flex;
flex-direction: column;
gap: var(--ams-column-gap-md);
}

@each $size, $label in $ams-sizes {
@each $size, $label in size.$ams-sizes {
@if $size != "md" {
.ams-column--gap-#{$label} {
gap: var(--ams-column-gap-#{$size});
Expand Down
4 changes: 2 additions & 2 deletions packages/css/src/components/date-input/date-input.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Copyright Gemeente Amsterdam
*/

@import "../../common/text-rendering";
@use "../../common/text-rendering";

@mixin reset-input {
-webkit-appearance: none; // Reset appearance for Safari < 15.4
Expand Down Expand Up @@ -35,7 +35,7 @@
padding-inline: var(--ams-date-input-padding-inline);
touch-action: manipulation;

@include text-rendering;
@include text-rendering.text-rendering;
@include reset-input;

&:hover {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
* Copyright Gemeente Amsterdam
*/

@import "../../common/breakpoint";
@import "../../common/text-rendering";
@use "../../common/breakpoint";
@use "../../common/text-rendering";

@mixin reset-dl {
margin-block: 0;
Expand All @@ -21,10 +21,10 @@
row-gap: var(--ams-description-list-row-gap);

@include reset-dl;
@include text-rendering;
@include text-rendering.text-rendering;
}

@media screen and (min-width: $ams-breakpoint-medium) {
@media screen and (min-width: breakpoint.$ams-breakpoint-medium) {
.ams-description-list {
grid-template-columns: auto 1fr;
}
Expand All @@ -49,7 +49,7 @@
.ams-description-list__term {
font-weight: var(--ams-description-list-term-font-weight);

@media screen and (min-width: $ams-breakpoint-medium) {
@media screen and (min-width: breakpoint.$ams-breakpoint-medium) {
grid-column-start: 1;
}
}
Expand All @@ -64,7 +64,7 @@

@include reset-dd;

@media screen and (min-width: $ams-breakpoint-medium) {
@media screen and (min-width: breakpoint.$ams-breakpoint-medium) {
grid-column-start: 2;
padding-inline-start: 0;
}
Expand Down
4 changes: 2 additions & 2 deletions packages/css/src/components/error-message/error-message.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Copyright Gemeente Amsterdam
*/

@import "../../common/text-rendering";
@use "../../common/text-rendering";

@mixin reset-p {
margin-block: 0;
Expand All @@ -19,6 +19,6 @@
gap: var(--ams-error-message-gap);
line-height: var(--ams-error-message-line-height);

@include text-rendering;
@include text-rendering.text-rendering;
@include reset-p;
}
8 changes: 4 additions & 4 deletions packages/css/src/components/field-set/field-set.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
* Copyright Gemeente Amsterdam
*/

@import "../../common/hyphenation";
@import "../../common/text-rendering";
@use "../../common/hyphenation";
@use "../../common/text-rendering";

@mixin reset-fieldset {
border: 0;
Expand Down Expand Up @@ -46,7 +46,7 @@
--ams-field-set-legend-margin-block-end
); /* Because of a bug in Chrome we can’t use display grid or flex for this gap */

@include hyphenation;
@include text-rendering;
@include hyphenation.hyphenation;
@include text-rendering.text-rendering;
@include reset-legend;
}
Loading
Loading