Created
October 3, 2011 16:53
-
-
Save codingdesigner/1259587 to your computer and use it in GitHub Desktop.
convert px to em in sass
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
// convert px to em in sass. | |
// $target-px: the value you want to convert | |
// $context: the current pixel value of 1em | |
@function calc-em($target-px, $context) { | |
@return ($target-px / $context) * 1em; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment