hypothetical/resources/sass/functions/_pxrem.scss

9 lines
220 B
SCSS
Raw Normal View History

//
// Convert px to the equivalent rem based on $base-font-size
//
// Usage example: pxrem(32) or pxrem(32px) => 2rem
//
@function pxrem($size) {
@return ((strip-unit($size) / strip-unit($base-font-size)) * 1rem);
}