sam-r
8/29/2014 - 7:38 PM

Compass px to em

@function em($target, $context: $base-font-size) {
   @if $target == 0 { @return 0 }
   @return $target / $context + 0em;
}

$base-font-size: 15px;

h1 {
	font-size: em(21px, 15px); // Outputs 1.4em
}