Skip to content

Commit d7096dd

Browse files
committed
refactor: replace percentage() with math.percentage()
1 parent e6ed109 commit d7096dd

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

scss/mixins/_grid.scss

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
@use "sass:map";
2+
@use "sass:math";
23
@use "sass:meta";
34
@use "../variables" as *;
45
@use "../maps" as *;
@@ -38,7 +39,7 @@
3839
@mixin make-col($size: false, $columns: $grid-columns) {
3940
@if $size {
4041
flex: 0 0 auto;
41-
width: percentage(divide($size, $columns));
42+
width: math.percentage(divide($size, $columns));
4243

4344
} @else {
4445
flex: 1 1 0;
@@ -53,7 +54,7 @@
5354

5455
@mixin make-col-offset($size, $columns: $grid-columns) {
5556
$num: divide($size, $columns);
56-
@include ltr-rtl("margin-left", if($num == 0, 0, percentage($num)));
57+
@include ltr-rtl("margin-left", if($num == 0, 0, math.percentage($num)));
5758
}
5859

5960
// Row columns
@@ -64,7 +65,7 @@
6465
@mixin row-cols($count) {
6566
> * {
6667
flex: 0 0 auto;
67-
width: percentage(divide(1, $count));
68+
width: math.percentage(divide(1, $count));
6869
}
6970
}
7071

scss/mixins/_table-variants.scss

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
@use "sass:color";
2+
@use "sass:math";
23
@use "../variables" as *;
34
@use "../functions/color-contrast" as *;
45

56
// scss-docs-start table-variant
67
@mixin table-variant($state, $background) {
78
.table-#{$state} {
89
$color: color-contrast(opaque($body-bg, $background));
9-
$hover-bg: color.mix($color, $background, percentage($table-hover-bg-factor));
10-
$striped-bg: color.mix($color, $background, percentage($table-striped-bg-factor));
11-
$active-bg: color.mix($color, $background, percentage($table-active-bg-factor));
12-
$table-border-color: color.mix($color, $background, percentage($table-border-factor));
10+
$hover-bg: color.mix($color, $background, math.percentage($table-hover-bg-factor));
11+
$striped-bg: color.mix($color, $background, math.percentage($table-striped-bg-factor));
12+
$active-bg: color.mix($color, $background, math.percentage($table-active-bg-factor));
13+
$table-border-color: color.mix($color, $background, math.percentage($table-border-factor));
1314

1415
--#{$prefix}table-color: #{$color};
1516
--#{$prefix}table-bg: #{$background};

0 commit comments

Comments
 (0)