Skip to content

Instantly share code, notes, and snippets.

@ajtroxell
Created June 14, 2013 20:23
Show Gist options
  • Save ajtroxell/5784975 to your computer and use it in GitHub Desktop.
Save ajtroxell/5784975 to your computer and use it in GitHub Desktop.
LESS Font and Line Height Mixin from: http://ajtroxell.com/less-font-and-line-height-mixin/
.font-size(@font-size: 16){
@pxFontValue: (@font-size / 10);
@pxLineValue: (@font-size / 10 * 1.5);
font-size: @font-size * 1px;
line-height: @font-size * 1.5 * 1px;
font-size: ~"@{pxFontValue}rem";
line-height: ~"@{pxLineValue}rem";
}
h1 {
font-size:14px;
line-height:21px;
font-size:1.4rem;
line-height:2.0999999999999996rem;
}
h1 { .font-size(14); }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment