Skip to content

Instantly share code, notes, and snippets.

@timsnadden
Created April 2, 2013 07:38
Show Gist options
  • Save timsnadden/5290562 to your computer and use it in GitHub Desktop.
Save timsnadden/5290562 to your computer and use it in GitHub Desktop.
Less mixin for doing font-sizing/line-heights with rems and falling back to px for browsers without rem support.
.font-size(@sizeValue){
@remValue: @sizeValue / 10;
@pxValue: (@sizeValue);
font-size: ~"@{pxValue}px";
font-size: ~"@{remValue}rem";
}
.line-height(@sizeValue){
@remValue: @sizeValue / 10;
@pxValue: (@sizeValue);
line-height: ~"@{pxValue}px";
line-height: ~"@{remValue}rem";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment