Skip to content

Instantly share code, notes, and snippets.

@stowball
Last active April 12, 2016 01:50
Show Gist options
  • Select an option

  • Save stowball/f2e37956cc673f4db91aa72e584f53b2 to your computer and use it in GitHub Desktop.

Select an option

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
@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