Created
July 31, 2012 14:40
-
-
Save krisbulman/3217486 to your computer and use it in GitHub Desktop.
CSS Summit - PX to EM
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
// Thanks to Chris Eppstein for this gem | |
$base-line-height: 18px !default; | |
$base-font-size: 13px !default; | |
$base-em-ratio: 1em / $base-font-size !default; // used by the px-to-em function below | |
// Converts px to em in case you do need relative units in your output. | |
@function px-to-em($value, $em-ratio: $base-em-ratio) { | |
@return $value * $em-ratio; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment