Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate the use of slash to math.div #594

Merged
merged 1 commit into from
May 24, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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