Skip to content

Instantly share code, notes, and snippets.

@alirezas
Created March 30, 2013 21:12
Show Gist options
  • Save alirezas/5278354 to your computer and use it in GitHub Desktop.
Save alirezas/5278354 to your computer and use it in GitHub Desktop.
$base-font-size: 18px;
// Convert PX to EM
@function em($px, $bfs: $base-font-size){
@return ($px / $bfs) + 0em;
}
// Usage:
body {
font-size: em(24px);
}
// Or for custom base font size.
body {
font-size: em(24, 14);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment