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
}

0 commit comments

Comments
 (0)