Skip to content

Instantly share code, notes, and snippets.

@szpakoli
Created July 2, 2013 15:01
Show Gist options
  • Save szpakoli/5910046 to your computer and use it in GitHub Desktop.
Save szpakoli/5910046 to your computer and use it in GitHub Desktop.
CSS Font Sizes - REMs with PX fallback for older broswers (snippet pulled from Base Framework: http://matthewhartman.github.io/base/)
// Font Sizes (REMs with PX fallback for older browsers)
.font-size (@sizeValue) {
@remValue: @sizeValue / 16;
@pxValue: (@sizeValue);
font-size: ~"@{pxValue}px";
font-size: ~"@{remValue}rem";
}
// Line Height Sizes (REMs with PX fallback for older browsers)
.line-height (@sizeValue) {
@remValue: @sizeValue / 16;
@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