Skip to content

Instantly share code, notes, and snippets.

@victorferraz
Created September 22, 2013 22:47
Show Gist options
  • Save victorferraz/6664598 to your computer and use it in GitHub Desktop.
Save victorferraz/6664598 to your computer and use it in GitHub Desktop.
convert px to em
$base-font-size: 14px;
@function em($px : 0, $base: $base-font-size) {
$value : 0;
@if $px > 0 and $base > 0{
$value : ($px / $base) * 1em;
}@else{
$value : 0;
}
@return $value;
}
.title {
font-size: em(20em); //Vai gerar o em corre2tamente :)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment