Update _units.scss

This commit is contained in:
Chris Chen 2024-04-07 09:50:56 -07:00
parent d1039a409b
commit 8961490ff8

View File

@ -5,9 +5,9 @@
// Function for converting a px based font-size to rem. // Function for converting a px based font-size to rem.
@function parseInt($n) { @function parseInt($n) {
@if ($n == !important) { @if ($n == !important) {
@return !important @return !important;
} @else { } @else {
$rem-size: $n / 14px; $rem-size: calc($n / 14px);
@return #{$rem-size}rem; @return #{$rem-size}rem;
} }
} }
@ -18,10 +18,9 @@
@each $value in $values { @each $value in $values {
@if index((0, 0px), $value) or $value == auto { @if index((0, 0px), $value) or $value == auto {
$rem: append($rem, $value); $rem: append($rem, $value);
} } @else {
@else {
$rem: append($rem, parseInt($value)); $rem: append($rem, parseInt($value));
} }
} }
#{$property}: $rem; #{$property}: $rem;
} }