Last active
April 12, 2016 01:50
-
-
Save stowball/f2e37956cc673f4db91aa72e584f53b2 to your computer and use it in GitHub Desktop.
A tiny little Sass function to convert a target and context to an em or unitless equivalent
This file contains hidden or 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 em($target, $context, $unitless: false) { | |
| $unit: if($unitless, 1, 1em); | |
| @return strip-unit($target / $context) * $unit; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment