Skip to content

Instantly share code, notes, and snippets.

@napotopia
Created October 7, 2013 13:07
Show Gist options
  • Save napotopia/6867699 to your computer and use it in GitHub Desktop.
Save napotopia/6867699 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
// ----
// Sass (v3.2.10)
// Compass (v0.13.alpha.4)
// ----
$basePixelSize:12;
@function calcFontSize($value:100, $_unit:$unit, $base:$basePixelSize) {
@if $_unit == 'px' {
@return ($base * $value / 100)#{$_unit};
}
@if $_unit == 'rem' {
@return ($value / 100)#{$_unit};
}
@if $_unit == '%' {
@return $value#{$_unit};
}
}
@mixin fontSize($_size:null, $_unit:$unit, $_fbUnit:$fbUnit) {
font-size: calcFontSize($_size, $_fbUnit); //percent (%) equivalent to 11px
font-size: calcFontSize($_size, $_unit); //rem equivalent to 11px
}
.foo{
@include fontSize(91.6667,'rem','px');
}
.foo {
font-size: 11.0px;
font-size: 0.91667rem;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment