Created
December 12, 2014 10:08
-
-
Save Webbist-dev/f0cea3e2042284929401 to your computer and use it in GitHub Desktop.
convert pixel 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($pxval) { | |
$val: strip-unit($pxval); | |
$base: strip-unit($browser-default-font-size); | |
@if ($old-ie == true) { | |
@return $val * 1px; | |
} | |
@else { | |
@return ($val / $base) * 1rem; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment