Skip to content

Commit

Permalink
πŸ› Use sass:math module to preserve browser suport
Browse files Browse the repository at this point in the history
  • Loading branch information
sprioleau committed Aug 13, 2022
1 parent dde9670 commit 80d395d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions stylesheets/breakpoint/_helpers.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
//////////////////////////////
// Converts the input value to Base EMs
//////////////////////////////

@use "sass:math";

@function breakpoint-to-base-em($value) {
$value-unit: unit($value);

Expand All @@ -25,16 +28,16 @@
$unit: unit($value);
@if $unit == 'px' {
@return calc($value / 16px) * 1em;
@return math.div($value / 16px) * 1em;
}
@else if $unit == '%' {
@return calc($value / 100%) * 1em;
@return math.div($value / 100%) * 1em;
}
@else if $unit == 'em' {
@return $value;
}
@else if $unit == 'pt' {
@return calc($value / 12pt) * 1em;
@return math.div($value / 12pt) * 1em;
}
@else {
@return $value;
Expand Down

0 comments on commit 80d395d

Please sign in to comment.