Skip to content

Commit

Permalink
feat: Replace deprecated import statements in Sass with new API (#1777)
Browse files Browse the repository at this point in the history
Co-authored-by: Vincent Smedinga <[email protected]>
  • Loading branch information
dlnr and VincentSmedinga authored Dec 13, 2024
1 parent f8e89c1 commit adcd819
Show file tree
Hide file tree
Showing 41 changed files with 124 additions and 120 deletions.
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
4 changes: 2 additions & 2 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" as *;
@use "../../common/text-rendering" as *;

@mixin reset-blockquote {
margin-block: 0;
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
6 changes: 3 additions & 3 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" as *;
@use "../grid/grid" as *;
@use "../grid/mixins" as *;

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

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
6 changes: 3 additions & 3 deletions packages/css/src/components/checkbox/checkbox.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
* Copyright Gemeente Amsterdam
*/

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

.ams-checkbox__input {
@include hide-input;
Expand Down
2 changes: 1 addition & 1 deletion packages/css/src/components/column/column.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Copyright Gemeente Amsterdam
*/

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

.ams-column {
display: flex;
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" as *;
@use "../../common/text-rendering" as *;

@mixin reset-dl {
margin-block: 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
4 changes: 2 additions & 2 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" as *;
@use "../../common/text-rendering" as *;

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

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

@each $size in map-keys($ams-sizes) {
@each $size in map.keys($ams-sizes) {
@if $size != "no" {
.ams-gap--#{$size} {
grid-gap: var(--ams-gap-#{$size}) !important;
Expand Down
2 changes: 2 additions & 0 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" as *;

/**
* @license EUPL-1.2+
* Copyright Gemeente Amsterdam
Expand Down
4 changes: 2 additions & 2 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" as *;
@use "mixins" as *;

$ams-grid-column-count: 12;

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

.ams-header {
align-items: center;
Expand Down
4 changes: 2 additions & 2 deletions packages/css/src/components/heading/heading.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" as *;
@use "../../common/text-rendering" as *;

@mixin reset-hx {
margin-block: 0;
Expand Down
2 changes: 1 addition & 1 deletion packages/css/src/components/image-slider/image-slider.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @license EUPL-1.2+
* Copyright Gemeente Amsterdam
*/
@import "../../common/breakpoint";
@use "../../common/breakpoint" as *;

.ams-image-slider {
display: grid;
Expand Down
126 changes: 63 additions & 63 deletions packages/css/src/components/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,66 +4,66 @@
*/

/* Append here */
@import "./action-group/action-group";
@import "./breakout/breakout";
@import "./hint/hint";
@import "./password-input/password-input";
@import "./form-error-list/form-error-list";
@import "./image-slider/image-slider";
@import "./table-of-contents/table-of-contents";
@import "./error-message/error-message";
@import "./file-input/file-input";
@import "./field/field";
@import "./select/select";
@import "./time-input/time-input";
@import "./date-input/date-input";
@import "./document/document";
@import "./avatar/avatar";
@import "./character-count/character-count";
@import "./description-list/description-list";
@import "./row/row";
@import "./radio/radio";
@import "./tabs/tabs";
@import "./text-area/text-area";
@import "./column/column";
@import "./margin/margin";
@import "./gap/gap";
@import "./field-set/field-set";
@import "./link-list/link-list";
@import "./badge/badge";
@import "./table/table";
@import "./mega-menu/mega-menu";
@import "./icon-button/icon-button";
@import "./skip-link/skip-link";
@import "./overlap/overlap";
@import "./header/header";
@import "./mark/mark";
@import "./text-input/text-input";
@import "./search-field/search-field";
@import "./logo/logo";
@import "./dialog/dialog";
@import "./image/image";
@import "./pagination/pagination";
@import "./accordion/accordion";
@import "./alert/alert";
@import "./aspect-ratio/aspect-ratio";
@import "./blockquote/blockquote";
@import "./breadcrumb/breadcrumb";
@import "./button/button";
@import "./card/card";
@import "./checkbox/checkbox";
@import "./label/label";
@import "./grid/grid";
@import "./heading/heading";
@import "./spotlight/spotlight";
@import "./icon/icon";
@import "./link/link";
@import "./ordered-list/ordered-list";
@import "./page-heading/page-heading";
@import "./page-menu/page-menu";
@import "./paragraph/paragraph";
@import "./screen/screen";
@import "./switch/switch";
@import "./top-task-link/top-task-link";
@import "./unordered-list/unordered-list";
@import "./visually-hidden/visually-hidden";
@use "action-group/action-group";
@use "breakout/breakout";
@use "hint/hint";
@use "password-input/password-input";
@use "form-error-list/form-error-list";
@use "image-slider/image-slider";
@use "table-of-contents/table-of-contents";
@use "error-message/error-message";
@use "file-input/file-input";
@use "field/field";
@use "select/select";
@use "time-input/time-input";
@use "date-input/date-input";
@use "document/document";
@use "avatar/avatar";
@use "character-count/character-count";
@use "description-list/description-list";
@use "row/row";
@use "radio/radio";
@use "tabs/tabs";
@use "text-area/text-area";
@use "column/column";
@use "margin/margin";
@use "gap/gap";
@use "field-set/field-set";
@use "link-list/link-list";
@use "badge/badge";
@use "table/table";
@use "mega-menu/mega-menu";
@use "icon-button/icon-button";
@use "skip-link/skip-link";
@use "overlap/overlap";
@use "header/header";
@use "mark/mark";
@use "text-input/text-input";
@use "search-field/search-field";
@use "logo/logo";
@use "dialog/dialog";
@use "image/image";
@use "pagination/pagination";
@use "accordion/accordion";
@use "alert/alert";
@use "aspect-ratio/aspect-ratio";
@use "blockquote/blockquote";
@use "breadcrumb/breadcrumb";
@use "button/button";
@use "card/card";
@use "checkbox/checkbox";
@use "label/label";
@use "grid/grid";
@use "heading/heading";
@use "spotlight/spotlight";
@use "icon/icon";
@use "link/link";
@use "ordered-list/ordered-list";
@use "page-heading/page-heading";
@use "page-menu/page-menu";
@use "paragraph/paragraph";
@use "screen/screen";
@use "switch/switch";
@use "top-task-link/top-task-link";
@use "unordered-list/unordered-list";
@use "visually-hidden/visually-hidden";
4 changes: 2 additions & 2 deletions packages/css/src/components/label/label.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" as *;
@use "../../common/text-rendering" as *;

.ams-label {
color: var(--ams-label-color);
Expand Down
4 changes: 2 additions & 2 deletions packages/css/src/components/link-list/link-list.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" as *;
@use "../../common/text-rendering" as *;

@mixin reset-ul {
list-style: none;
Expand Down
2 changes: 1 addition & 1 deletion packages/css/src/components/link/link.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-link {
color: var(--ams-link-color);
Expand Down
5 changes: 3 additions & 2 deletions packages/css/src/components/margin/margin.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
* Copyright Gemeente Amsterdam
*/

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

@each $size in map-keys($ams-sizes) {
@each $size in map.keys($ams-sizes) {
@if $size != "no" {
.ams-mb--#{$size} {
margin-block-end: var(--ams-margin-#{$size}) !important;
Expand Down
2 changes: 1 addition & 1 deletion packages/css/src/components/ordered-list/ordered-list.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 {
list-style-type: none;
Expand Down
4 changes: 2 additions & 2 deletions packages/css/src/components/page-heading/page-heading.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" as *;
@use "../../common/text-rendering" as *;

@mixin reset-h1 {
margin-block: 0;
Expand Down
2 changes: 1 addition & 1 deletion packages/css/src/components/page-menu/page-menu.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-ul {
margin-block: 0;
Expand Down
Loading

0 comments on commit adcd819

Please sign in to comment.