Skip to content

Commit cc295b3

Browse files
authored
Merge pull request #432 from BeAPI/chore/update-sass-deprecations-rules
chore (scss): replace all deprecated rules in latest dart sass changes
2 parents 16f91c7 + 6e4b987 commit cc295b3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+427
-245
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@
5151
"postcss-scss": "^4.0.6",
5252
"postcss-sort-media-queries": "^5.2.0",
5353
"prettier": "^2.2.1",
54-
"sass": "^1.52.3",
55-
"sass-loader": "^11.0.1",
54+
"sass": "^1.85.1",
55+
"sass-loader": "^16.0.5",
5656
"sharp": "^0.32.1",
5757
"style-loader": "^2.0.0",
5858
"stylelint": "^14.13.0",

src/scss/01-abstract/_variables.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
@use "sass:map";
22
@use "sass:math";
33

4+
$entry-file-name: "undefined";
5+
46
/**
57
* Variables
68
*/

src/scss/01-abstract/abstract.scss

Lines changed: 0 additions & 2 deletions
This file was deleted.

src/scss/02-tools/_f-column.scss

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
@use "sass:meta";
2+
@use "../01-abstract/variables" as *;
3+
14
@use "sass:map";
25
@use "sass:math";
36

@@ -68,7 +71,7 @@
6871

6972
@function column($device, $nb-column: null, $nb-gutter: null, $total-column: null, $total-gutter: null) {
7073
// shift vars if $device is number
71-
@if type-of($device) == "number" {
74+
@if meta.type-of($device) == "number" {
7275
$total-gutter: $total-column;
7376
$total-column: $nb-gutter;
7477
$nb-gutter: $nb-column;
@@ -98,7 +101,7 @@
98101

99102
@function column-px($device, $nb-column: null, $nb-gutter: null, $unitless: false) {
100103
// shift vars if $device is number
101-
@if type-of($device) == "number" {
104+
@if meta.type-of($device) == "number" {
102105
$nb-gutter: $nb-column;
103106
$nb-column: $device;
104107
$device: d;
@@ -125,7 +128,7 @@
125128

126129
@function column-full($device, $nb-column: null, $nb-gutter: null) {
127130
// shift vars if $device is number
128-
@if type-of($device) == "number" {
131+
@if meta.type-of($device) == "number" {
129132
$nb-gutter: $nb-column;
130133
$nb-column: $device;
131134
$device: d;

src/scss/02-tools/_f-context-align.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
@use "../01-abstract/variables" as *;
2+
13
/**
24
* Align - Make a context align (editor / style)
35
*

src/scss/02-tools/_f-context-selector.scss

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
@use "sass:meta";
2+
@use "../01-abstract/variables" as *;
3+
14
/**
25
* Context selector - Make a context selector (editor / style)
36
*
@@ -61,9 +64,9 @@
6164
@return $selector;
6265
}
6366

64-
@if (type-of($selector) == "string") {
67+
@if (meta.type-of($selector) == "string") {
6568
$full-selector: $parent + " " + $selector;
66-
} @else if (type-of($selector) == "list") {
69+
} @else if (meta.type-of($selector) == "list") {
6770
@each $s in $selector {
6871
$full-selector: $full-selector + $parent + " " + $s;
6972
}

src/scss/02-tools/_f-em.scss

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
@use "../01-abstract/variables" as *;
2+
@use "f-strip-units" as *;
3+
14
@use "sass:math";
25

36
/**
@@ -22,11 +25,11 @@
2225

2326
@function em($pxval, $base: $font-size-base) {
2427

25-
@if not unitless($pxval) {
28+
@if not math.is-unitless($pxval) {
2629
$pxval: strip-units($pxval);
2730
}
2831

29-
@if not unitless($base) {
32+
@if not math.is-unitless($base) {
3033
$base: strip-units($base);
3134
}
3235

src/scss/02-tools/_f-fluid-size.scss

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
@use "../01-abstract/variables" as *;
2+
@use "f-strip-units" as *;
3+
14
/**
25
* Fluid size
36
*

src/scss/02-tools/_f-get-gutter-width.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
@use "../01-abstract/variables" as *;
12
@use "sass:map";
23

34
/**

src/scss/02-tools/_f-get-svg-url.scss

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
@use "../01-abstract/variables" as *;
2+
@use "sass:color";
3+
@use "sass:list";
14
@use "sass:map";
25

36
/**
@@ -40,7 +43,7 @@
4043
"close": ("0 0 20 20", "3Cpath d='M5.442 5.442 5 5.883l2.058 2.059L9.116 10l-2.058 2.058L5 14.117l.442.441.441.442 2.059-2.058L10 10.884l2.058 2.058L14.117 15l.441-.442.442-.441-2.058-2.059L10.884 10l2.058-2.058L15 5.883l-.442-.441L14.117 5l-2.059 2.058L10 9.116 7.942 7.058 5.883 5l-.441.442'/%3E"),
4144
);
4245

43-
@if not map-has-key($svgs, $name) {
46+
@if not map.has-key($svgs, $name) {
4447
@return "";
4548
}
4649

@@ -49,8 +52,8 @@
4952
}
5053

5154
@if ($fill != "") {
52-
$fill: " fill='rgba(#{red($fill), green($fill), blue($fill), $opacity})'";
55+
$fill: " fill='rgba(#{color.channel($fill, 'red'), color.channel($fill, 'green'), color.channel($fill, 'blue'), $opacity})'";
5356
}
5457

55-
@return url("data:image/svg+xml;charset=utf8, %3Csvg xmlns='http://www.w3.org/2000/svg'" + $fill + $style + " viewBox='" + nth(map.get($svgs, $name), 1) + "'%3E%" + nth(map.get($svgs, $name), 2) + "%3C/svg%3E"); /* stylelint-disable-line */
58+
@return url("data:image/svg+xml;charset=utf8, %3Csvg xmlns='http://www.w3.org/2000/svg'" + $fill + $style + " viewBox='" + list.nth(map.get($svgs, $name), 1) + "'%3E%" + list.nth(map.get($svgs, $name), 2) + "%3C/svg%3E"); /* stylelint-disable-line */
5659
}

src/scss/02-tools/_m-bg-fullwidth.scss

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
@use "../01-abstract/variables" as *;
2+
@use "m-style-only" as *;
3+
14
/**
25
* Background fullwidth - Make a fullwidth background in a container element
36
*

src/scss/02-tools/_m-block-vertical-spacing.scss

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
@use "f-context-selector";
2+
13
/**
24
* Block vertical spacing
35
*/
@@ -22,7 +24,7 @@
2224
*
2325
*/
2426
@mixin block-vertical-spacing($type : margin, $spacing : var(--spacing--block-3)) {
25-
#{context-selector(".blocks-container > &", ".is-root-container > &, .is-root-container > .wp-block[data-align] > &, .is-root-container > .acf-block-preview > &, .is-root-container > .wp-block-beapi-dynamic-block &, .is-root-container > .wp-block-beapi-manual-block &, .is-root-container > .wp-block[data-align] > .acf-block-preview > &, .is-root-container > .wp-block[data-align] > .wp-block-beapi-dynamic-block &, .is-root-container > .wp-block[data-align] > .wp-block-beapi-manual-block &")} {
27+
#{f-context-selector.context-selector(".blocks-container > &", ".is-root-container > &, .is-root-container > .wp-block[data-align] > &, .is-root-container > .acf-block-preview > &, .is-root-container > .wp-block-beapi-dynamic-block &, .is-root-container > .wp-block-beapi-manual-block &, .is-root-container > .wp-block[data-align] > .acf-block-preview > &, .is-root-container > .wp-block[data-align] > .wp-block-beapi-dynamic-block &, .is-root-container > .wp-block[data-align] > .wp-block-beapi-manual-block &")} {
2628
#{$type}-top: $spacing;
2729
#{$type}-bottom: $spacing;
2830

src/scss/02-tools/_m-breakpoint.scss

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
@use "sass:meta";
2+
@use "../01-abstract/variables" as *;
3+
@use "f-em" as *;
4+
15
@use "sass:map";
26

37
/**
@@ -24,7 +28,7 @@
2428
@mixin breakpoints($breakpoint, $min-or-max-or-breakpoint: min) {
2529
$font-size: 16px; // don't use em function whitout param, $font-size-base can be modified
2630

27-
@if (type-of(map.get($breakpoints, $min-or-max-or-breakpoint)) == "number") {
31+
@if (meta.type-of(map.get($breakpoints, $min-or-max-or-breakpoint)) == "number") {
2832

2933
@media screen and (min-width: em(map.get($breakpoints, $breakpoint), $font-size)) and (max-width: em(map.get($breakpoints, $min-or-max-or-breakpoint) - 1, $font-size)) {
3034
@content;

src/scss/02-tools/_m-btn.scss

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
@use "../01-abstract/variables" as *;
2+
@use "m-hover" as *;
3+
14
/**
25
* Button - All mixins for buttons - Used in src/scss/05-components/_btn.scss
36
*

src/scss/02-tools/_m-checkbox-custom.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
@use "../01-abstract/variables" as *;
2+
@use "m-rtl" as *;
3+
@use "m-sr-only" as *;
4+
15
@use "sass:math";
26

37
/**

src/scss/02-tools/_m-container-query.scss

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
@use "sass:meta";
2+
@use "../01-abstract/variables" as *;
3+
@use "f-em" as *;
4+
15
@use "sass:map";
26

37
/**
@@ -25,7 +29,7 @@
2529
@mixin container-query($breakpoint, $min-or-max-or-breakpoint: min, $container-name: "") {
2630
$font-size: 16px; // don't use em function whitout param, $font-size-base can be modified
2731

28-
@if (type-of(map.get($breakpoints, $min-or-max-or-breakpoint)) == "number") {
32+
@if (meta.type-of(map.get($breakpoints, $min-or-max-or-breakpoint)) == "number") {
2933

3034
@container #{$container-name} (min-width: #{em(map.get($breakpoints, $breakpoint), $font-size)}) and (max-width: #{em(map.get($breakpoints, $min-or-max-or-breakpoint) - 1, $font-size)}) {
3135

src/scss/02-tools/_m-container.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
@use "../01-abstract/variables" as *;
2+
13
/**
24
* Container
35
*

src/scss/02-tools/_m-editor-only.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
@use "../01-abstract/variables" as *;
2+
13
/**
24
* Editor style only
35
*

src/scss/02-tools/_m-heading.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
@use "../01-abstract/variables" as *;
2+
13
/**
24
* Heading - Used in src/scss/06-blocks/core/_heading.scss
35
*

src/scss/02-tools/_m-hover.scss

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
@use "sass:meta";
12
@use "sass:list";
23

34
/**
@@ -44,10 +45,10 @@
4445
$selectors: "&:hover", "&:active", "&:focus";
4546

4647
@if ($additionalSelectors) {
47-
@if (type-of($additionalSelectors) == "string") {
48+
@if (meta.type-of($additionalSelectors) == "string") {
4849
$selectors: $selectors "," $additionalSelectors;
4950
}
50-
@else if (type-of($additionalSelectors) == "list") {
51+
@else if (meta.type-of($additionalSelectors) == "list") {
5152
$selectors: list.join($selectors, $additionalSelectors, comma);
5253
}
5354
}

src/scss/02-tools/_m-not-acf.scss

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
@use "f-context-selector";
2+
13
/**
24
* Not apply style to ACF fields
35
*
@@ -14,7 +16,7 @@
1416
*/
1517

1618
@mixin not-acf() {
17-
#{context-selector(":where(body)", ":where(*:not([class*="acf-"])) >")} {
19+
#{f-context-selector.context-selector(":where(body)", ":where(*:not([class*="acf-"])) >")} {
1820
@content;
1921
}
2022
}

src/scss/02-tools/_m-radio-custom.scss

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
@use "../01-abstract/variables" as *;
2+
@use "m-checkbox-custom";
3+
14
@use "sass:math";
25

36
/**
@@ -28,7 +31,7 @@
2831

2932
@mixin radio-custom($include-checkbox-style: false, $color: $color-primary, $size: 18px, $border-width: 1px) {
3033
@if ($include-checkbox-style) {
31-
@include checkbox-custom($color, $size, $border-width);
34+
@include m-checkbox-custom.checkbox-custom($color, $size, $border-width);
3235
}
3336

3437
+ label {
@@ -48,5 +51,5 @@
4851
}
4952

5053
@mixin radio-custom-checked() {
51-
@include checkbox-custom-checked;
54+
@include m-checkbox-custom.checkbox-custom-checked;
5255
}

src/scss/02-tools/_m-scrollbar.scss

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
@use "m-hover";
2+
13
/**
24
* Scrollbar - Make an invisible scrollbar and custom the scrollbar color
35
*
@@ -55,7 +57,7 @@
5557
border-radius: 20px;
5658
}
5759

58-
@include hover {
60+
@include m-hover.hover {
5961
&::-webkit-scrollbar {
6062
display: block;
6163
}

src/scss/02-tools/_m-select-custom.scss

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
@use "../01-abstract/variables" as *;
2+
@use "f-get-svg-url" as *;
3+
@use "m-rtl" as *;
14
@use "sass:color";
25

36
/**

src/scss/02-tools/_m-style-only.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
@use "../01-abstract/variables" as *;
2+
13
/**
24
* Style for Frontend UI only
35
*

src/scss/02-tools/_m-text-icon.scss

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
@use "../01-abstract/constants" as *;
2+
@use "f-get-svg-url" as *;
3+
14
/**
25
* Add icon before text with mask to have the same color of the text
36
*

src/scss/02-tools/tools.scss

Lines changed: 0 additions & 41 deletions
This file was deleted.

src/scss/03-base/_body.scss

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
@use "../01-abstract/variables" as *;
2+
@use "../02-tools/m-rtl" as *;
3+
14
html {
25
/* Set automatic RTL direction depending on lang attribute */
36
@include set-rtl-direction;

src/scss/03-base/_forms.scss

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
@use "../01-abstract/variables" as *;
2+
@use "../02-tools/f-assign-inputs" as *;
3+
@use "../02-tools/f-get-svg-url" as *;
4+
@use "../02-tools/m-checkbox-custom" as *;
5+
@use "../02-tools/m-not-acf" as *;
6+
@use "../02-tools/m-radio-custom" as *;
7+
@use "../02-tools/m-select-custom" as *;
8+
@use "../05-components/btn";
9+
110
@use "sass:color";
211

312
// All inputs variables

0 commit comments

Comments
 (0)