Skip to content

Instantly share code, notes, and snippets.

@mb-dev
Created July 23, 2013 22:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mb-dev/6066871 to your computer and use it in GitHub Desktop.
Save mb-dev/6066871 to your computer and use it in GitHub Desktop.
@function pxtoem($pxval, $base: 14) {
@if (unitless($pxval)) {
$pxval: $pxval * 1px;
}
@if (unitless($base)) {
$base: $base * 1px;
}
@return $pxval / $base * 1em;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment