Skip to content

Commit 5ea8f8e

Browse files
committed
refactor: replace comparable() with math.compatible()
1 parent 8d4baeb commit 5ea8f8e

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

scss/functions/_assert.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
@each $key, $num in $map {
99
@if $prev-num == null or math.unit($num) == "%" or math.unit($prev-num) == "%" {
1010
// Do nothing
11-
} @else if not comparable($prev-num, $num) {
11+
} @else if not math.compatible($prev-num, $num) {
1212
@warn "Potentially invalid value for #{$map-name}: This map must be in ascending order, but key '#{$key}' has value #{$num} whose unit makes it incomparable to #{$prev-num}, the value of the previous key '#{$prev-key}' !";
1313
} @else if $prev-num >= $num {
1414
@warn "Invalid value for #{$map-name}: This map must be in ascending order, but key '#{$key}' has value #{$num} which isn't greater than #{$prev-num}, the value of the previous key '#{$prev-key}' !";

scss/functions/_math.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
@return $value1;
1111
}
1212

13-
@if type-of($value1) == number and type-of($value2) == number and comparable($value1, $value2) {
13+
@if type-of($value1) == number and type-of($value2) == number and math.compatible($value1, $value2) {
1414
@return $value1 + $value2;
1515
}
1616

@@ -30,7 +30,7 @@
3030
@return $value1;
3131
}
3232

33-
@if type-of($value1) == number and type-of($value2) == number and comparable($value1, $value2) {
33+
@if type-of($value1) == number and type-of($value2) == number and math.compatible($value1, $value2) {
3434
@return $value1 - $value2;
3535
}
3636

0 commit comments

Comments
 (0)