scss-framework/function/_rem.scss

15 lines
242 B
SCSS
Raw Permalink Normal View History

2025-07-19 23:58:24 +02:00
@function rem($pixel, $basis: 16) {
$negative: false;
@if ($pixel < 0) {
$negative: true;
$pixel: calc($pixel * -1);
}
$rem: calc($pixel / $basis);
@if ($negative) {
$rem: calc($rem * -1);
}
@return $rem + 0rem;
}