Skip to content

Instantly share code, notes, and snippets.

@paulakreuger
Forked from ijy/Compass px to em
Last active August 29, 2015 14:01
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 paulakreuger/8c4ca82ab7d29ebd412f to your computer and use it in GitHub Desktop.
Save paulakreuger/8c4ca82ab7d29ebd412f to your computer and use it in GitHub Desktop.
$browser-context: 16; // Default
@function em($pixels, $context: $browser-context) {
@return #{$pixels/$context}em
}
h1 {
font-size: em(21, 15); // Outputs 1.4em
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment