Skip to content

Instantly share code, notes, and snippets.

@droid001
Last active February 6, 2018 15:48
Show Gist options
  • Save droid001/979b7b66ad00ee3fa3208f3cc128cf7d to your computer and use it in GitHub Desktop.
Save droid001/979b7b66ad00ee3fa3208f3cc128cf7d to your computer and use it in GitHub Desktop.
transform font size to rems, optional line height
@mixin fontsize($font-size, $line-height:false) {
$size: strip-unit($font-size);
font-size: #{$size}px;
font-size: #{$size/strip-unit($base-font-size)}rem;
@if $line-height {
// line-height:ceil($font-size / $base-line-height) * ($base-line-height / $font-size);
line-height: $line-height;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment