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
2 changes: 1 addition & 1 deletion packages/css/src/components/accordion/accordion.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" as *;

.ams-accordion {
display: flex;
Expand Down
6 changes: 3 additions & 3 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" as *;

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

@include hyphenation;
@include hyphenation.hyphenation;
@include text-rendering;
VincentSmedinga marked this conversation as resolved.
Show resolved Hide resolved
@include reset-blockquote;

Expand Down
2 changes: 1 addition & 1 deletion 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" as *;

@mixin reset-ol {
margin-block: 0;
Expand Down
20 changes: 10 additions & 10 deletions packages/css/src/components/breakout/breakout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
* Copyright Gemeente Amsterdam
*/

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

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

Expand Down Expand Up @@ -72,7 +72,7 @@ $ams-breakout-row-span-max: 4;
@include 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);
}
Expand All @@ -82,8 +82,8 @@ $ams-breakout-row-span-max: 4;
}
}

@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);
}
Expand All @@ -94,8 +94,8 @@ $ams-breakout-row-span-max: 4;
}
}

@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);
}
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
2 changes: 1 addition & 1 deletion 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" as *;

@mixin reset-button {
border: 0;
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" as *;

.ams-character-count {
color: var(--ams-character-count-color);
Expand Down
10 changes: 5 additions & 5 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" as *;

.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
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
2 changes: 1 addition & 1 deletion 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" as *;

@mixin reset-input {
-webkit-appearance: none; // Reset appearance for Safari < 15.4
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" as *;

@mixin reset-dl {
margin-block: 0;
Expand All @@ -24,7 +24,7 @@
@include 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
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" as *;

@mixin reset-p {
margin-block: 0;
Expand Down
6 changes: 3 additions & 3 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" as *;

@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 hyphenation.hyphenation;
@include text-rendering;
@include reset-legend;
}
2 changes: 1 addition & 1 deletion packages/css/src/components/file-input/file-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" as *;

@mixin reset-button {
border: 0;
Expand Down
5 changes: 3 additions & 2 deletions packages/css/src/components/gap/gap.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@
* Copyright Gemeente Amsterdam
*/

@import "../../common/size";
@use "sass:map";
@use "../../common/size";

[class|="ams-gap-"] {
display: grid !important;
}

@each $size in map-keys($ams-sizes) {
@each $size in map.keys(size.$ams-sizes) {
@if $size != "no" {
.ams-gap--#{$size} {
grid-gap: var(--ams-gap-#{$size}) !important;
Expand Down
14 changes: 8 additions & 6 deletions packages/css/src/components/grid/_mixins.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@use "../../common/breakpoint";

/**
* @license EUPL-1.2+
* Copyright Gemeente Amsterdam
Expand All @@ -10,11 +12,11 @@
padding-inline: var(--ams-grid-padding-inline);
row-gap: var(--ams-grid-row-gap-md);

@media screen and (min-width: $ams-breakpoint-medium) {
@media screen and (min-width: breakpoint.$ams-breakpoint-medium) {
grid-template-columns: repeat(var(--ams-grid-medium-column-count), 1fr);
}

@media screen and (min-width: $ams-breakpoint-wide) {
@media screen and (min-width: breakpoint.$ams-breakpoint-wide) {
grid-template-columns: repeat(var(--ams-grid-wide-column-count), 1fr);
}
}
Expand Down Expand Up @@ -86,25 +88,25 @@
}

@mixin ams-grid__cell--span-medium($i) {
@media screen and (min-width: $ams-breakpoint-medium) {
@media screen and (min-width: breakpoint.$ams-breakpoint-medium) {
grid-column-end: span $i;
}
}

@mixin ams-grid__cell--start-medium($i) {
@media screen and (min-width: $ams-breakpoint-medium) {
@media screen and (min-width: breakpoint.$ams-breakpoint-medium) {
grid-column-start: $i;
}
}

@mixin ams-grid__cell--span-wide($i) {
@media screen and (min-width: $ams-breakpoint-wide) {
@media screen and (min-width: breakpoint.$ams-breakpoint-wide) {
grid-column-end: span $i;
}
}

@mixin ams-grid__cell--start-wide($i) {
@media screen and (min-width: $ams-breakpoint-wide) {
@media screen and (min-width: breakpoint.$ams-breakpoint-wide) {
grid-column-start: $i;
}
}
8 changes: 4 additions & 4 deletions packages/css/src/components/grid/grid.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
* Copyright Gemeente Amsterdam
*/

@import "../../common/breakpoint";
@import "mixins";
@use "../../common/breakpoint";
@use "mixins" as *;

$ams-grid-column-count: 12;

Expand Down Expand Up @@ -81,7 +81,7 @@ $ams-grid-column-count: 12;
}
}

@media screen and (min-width: $ams-breakpoint-medium) {
@media screen and (min-width: breakpoint.$ams-breakpoint-medium) {
@for $i from 1 through $ams-grid-column-count {
.ams-grid__cell--span-#{$i}-medium {
@include ams-grid__cell--span-medium($i);
Expand All @@ -93,7 +93,7 @@ $ams-grid-column-count: 12;
}
}

@media screen and (min-width: $ams-breakpoint-wide) {
@media screen and (min-width: breakpoint.$ams-breakpoint-wide) {
@for $i from 1 through $ams-grid-column-count {
.ams-grid__cell--span-#{$i}-wide {
@include ams-grid__cell--span-wide($i);
Expand Down
12 changes: 6 additions & 6 deletions packages/css/src/components/header/header.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Copyright Gemeente Amsterdam
*/

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

.ams-header {
align-items: center;
Expand All @@ -12,7 +12,7 @@
padding-block: var(--ams-header-padding-block);
row-gap: 1.5rem;

@media screen and (min-width: $ams-breakpoint-wide) {
@media screen and (min-width: breakpoint.$ams-breakpoint-wide) {
column-gap: var(--ams-header-column-gap);
flex-wrap: nowrap;
}
Expand All @@ -26,12 +26,12 @@
.ams-header__links {
display: none;

@media screen and (min-width: $ams-breakpoint-medium) {
@media screen and (min-width: breakpoint.$ams-breakpoint-medium) {
display: block;
flex: 10 0 auto;
}

@media screen and (min-width: $ams-breakpoint-wide) {
@media screen and (min-width: breakpoint.$ams-breakpoint-wide) {
order: 3;
}
}
Expand All @@ -41,7 +41,7 @@
padding-inline-start: var(--ams-page-menu-column-gap); // TODO Don’t use tokens of another component
text-align: end;

@media screen and (min-width: $ams-breakpoint-wide) {
@media screen and (min-width: breakpoint.$ams-breakpoint-wide) {
order: 4;
padding-inline-start: 0;
}
Expand All @@ -50,7 +50,7 @@
.ams-header__app-name {
flex: 1 1 100%;

@media screen and (min-width: $ams-breakpoint-wide) {
@media screen and (min-width: breakpoint.$ams-breakpoint-wide) {
min-inline-size: 0;
order: 2;

Expand Down
Loading
Loading