21 lines
490 B
SCSS
21 lines
490 B
SCSS
// Convert pixels to rems
|
|
// eg. for a relational value of 12px write rem(12)
|
|
// Assumes $em-base is the font-size of <html>
|
|
|
|
@function rem($pxval) {
|
|
@if $output-bourbon-deprecation-warnings == true {
|
|
@warn "[Bourbon] [Deprecation] `rem` is deprecated and will be " +
|
|
"removed in 5.0.0.";
|
|
}
|
|
|
|
@if not unitless($pxval) {
|
|
$pxval: strip-units($pxval);
|
|
}
|
|
|
|
$base: $em-base;
|
|
@if not unitless($base) {
|
|
$base: strip-units($base);
|
|
}
|
|
@return ($pxval / $base) * 1rem;
|
|
}
|