grav/plugins/git-sync/scss/vendor/bourbon/functions/_px-to-rem.scss

16 lines
336 B
SCSS
Raw Normal View History

2023-01-09 02:00:36 +01:00
// 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 not unitless($pxval) {
$pxval: strip-units($pxval);
}
$base: $em-base;
@if not unitless($base) {
$base: strip-units($base);
}
@return ($pxval / $base) * 1rem;
}