Skip to content

Commit

Permalink
Migrate the use of slash to math.div (#594)
Browse files Browse the repository at this point in the history
Sass version `1.34.0` has  deprecated the use of slash (`/`) as a division operation in favor of the use of math module's `div()` method. This PR updates Vrembem's usage of division with the math module.
  • Loading branch information
sebnitu committed May 24, 2021
1 parent 86c3162 commit ed41738
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions packages/core/src/css/_functions.scss
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
$maps: ($map,);
$result: null;
@if meta.type-of(list.nth($keys, -1)) == "map" {
@warn "The last key you specified is a map; it will be overrided with `#{$value}`.";
@warn "The last key you specified is a map; it will be overridden with `#{$value}`.";
}
@if list.length($keys) == 1 {
@return map.merge($map, ($keys: $value));
Expand Down Expand Up @@ -90,7 +90,7 @@
/// @return {Number} - Unitless number
@function strip-unit($number) {
@if meta.type-of($number) == "number" and not math.is-unitless($number) {
@return $number / ($number * 0 + 1);
@return math.div($number, $number * 0 + 1);
}
@return $number;
}
Expand All @@ -106,7 +106,7 @@
@if math.is-unitless($base) {
$base: 1px * $base;
}
$px: ($px / $base) * 1em;
$px: math.div($px, $base) * 1em;
@return strip-unit($px) * 1em;
}

Expand All @@ -120,7 +120,7 @@
@if math.is-unitless(var.$font-size) {
$font-size: 1px * var.$font-size;
}
$px: ($px / $font-size) * 1rem;
$px: math.div($px, $font-size) * 1rem;
@return strip-unit($px) * 1rem;
}

Expand All @@ -135,7 +135,7 @@
@if math.is-unitless($base) {
$base: 1px * $base;
}
$em: ($em * $base) / 1px;
$em: math.div($em * $base, 1px);
@return strip-unit($em) * 1px;
}

Expand Down Expand Up @@ -234,7 +234,7 @@
) {
// Checkout base color to lightness threshold
@if (color.lightness($background-color) > var.$lightness-threshold) {
// Lighter backgorund, return dark color
// Lighter background, return dark color
@return $color-dark;
} @else {
// Darker background, return light color
Expand Down

0 comments on commit ed41738

Please sign in to comment.