Last active
May 31, 2019 11:16
-
-
Save artlili/d5b74008367837e4c3f4b2ca095637da to your computer and use it in GitHub Desktop.
px to rem
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@function rem($pixels, $context: $base-font-size) { | |
@if (unitless($pixels)) { | |
$pixels: $pixels * 1px; | |
} | |
@if (unitless($context)) { | |
$context: $context * 1px; | |
} | |
@return $pixels / $context * 1rem; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment