Skip to content

Commit bf50fc5

Browse files
committed
chore: reduce scss deprecations and warnings
Signed-off-by: Ulises Gascon <[email protected]>
1 parent 2ce3dbc commit bf50fc5

File tree

4 files changed

+25
-14
lines changed

4 files changed

+25
-14
lines changed

scorecards-site/assets/css/_mixins.scss

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
1+
@use "sass:string";
2+
@use "sass:map";
3+
14
// Mixin helper
25

36
// =============================================================================
47
// String Replace
58
// =============================================================================
69

710
@function str-replace($string, $search, $replace: '') {
8-
$index: str-index($string, $search);
11+
$index: string.index($string, $search);
912

1013
@if $index {
11-
@return str-slice($string, 1, $index - 1) + $replace +
14+
@return string.slice($string, 1, $index - 1) + $replace +
1215
str-replace(
13-
str-slice($string, $index + str-length($search)),
16+
string.slice($string, $index + string.length($search)),
1417
$search,
1518
$replace
1619
);
@@ -44,11 +47,11 @@
4447

4548
@each $ext in $exts {
4649
$extmod: if(
47-
map-has-key($extmods, $ext),
48-
$ext + map-get($extmods, $ext),
50+
map.get($extmods, $ext),
51+
$ext + map.get($extmods, $ext),
4952
$ext
5053
);
51-
$format: if(map-has-key($formats, $ext), map-get($formats, $ext), $ext);
54+
$format: if(map.get($formats, $ext), map.get($formats, $ext), $ext);
5255
$src: append(
5356
$src,
5457
url(quote($path + '.' + $extmod)) format(quote($format)),

scorecards-site/assets/css/helpers/_helper-colors.scss

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
@use "sass:color";
2+
13
.color,
24
%color {
35
&--black {
@@ -52,10 +54,10 @@
5254
}
5355

5456
&--warning {
55-
background-color: lighten($c-yellow, 5%);
57+
background-color: color.adjust($c-yellow, $lightness: 5%);
5658
}
5759

5860
&--alert {
59-
background-color: lighten($c-red, 8%);
61+
background-color: color.adjust($c-red, $lightness: 8%);
6062
}
6163
}

scorecards-site/assets/css/settings/_set-breakpoints.scss

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1+
@use 'sass:math';
2+
@use 'sass:meta';
3+
14
@function strip-unit($number) {
2-
@if type-of($number) == 'number' and not unitless($number) {
5+
@if meta.type-of($number) == 'number' and not math.is-unitless($number) {
36
@return math.div($number, $number * 0 + 1);
47
}
58

scorecards-site/assets/css/utilities/_utl-breakpoints.scss

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
@use "sass:list";
2+
@use "sass:map";
3+
14
// Breakpoint viewport sizes and media queries.
25
//
36
// Breakpoints are defined as a map of (name: minimum width), order from small to large:
@@ -17,17 +20,17 @@
1720
@function breakpoint-next(
1821
$name,
1922
$breakpoints: $grid-breakpoints,
20-
$breakpoint-names: map-keys($breakpoints)
23+
$breakpoint-names: map.keys($breakpoints)
2124
) {
22-
$n: index($breakpoint-names, $name);
25+
$n: list.index($breakpoint-names, $name);
2326

2427
@if not $n {
2528
@error "breakpoint `#{$name}` not found in `#{$breakpoints}`";
2629
}
2730

2831
@return if(
29-
$n < length($breakpoint-names),
30-
nth($breakpoint-names, $n + 1),
32+
$n < list.length($breakpoint-names),
33+
list.nth($breakpoint-names, $n + 1),
3134
null
3235
);
3336
}
@@ -37,7 +40,7 @@
3740
// >> breakpoint-min(sm, (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px))
3841
// 576px
3942
@function breakpoint-min($name, $breakpoints: $grid-breakpoints) {
40-
$min: map-get($breakpoints, $name);
43+
$min: map.get($breakpoints, $name);
4144

4245
@return if($min != 0, $min, null);
4346
}

0 commit comments

Comments
 (0)