Created
September 22, 2013 22:47
-
-
Save victorferraz/6664598 to your computer and use it in GitHub Desktop.
convert px to em
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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