Skip to content

Instantly share code, notes, and snippets.

@jabneyhastings
jabneyhastings / gist:1194732
Created September 5, 2011 11:25
LESS Snippet for using rem as a unit for font-size
// ABOUT
A simple LESS (http://lesscss.org) snippet based on http://snook.ca/archives/html_and_css/font-size-with-rem
It doesn't do much but saves you typing things twice, allowing you to use rem as a unit for font-sizes
and giving a px fallback for IE
// MIXIN
.font-size(@font-size: 16){
@rem: (@font-size / 10);
font-size: @font-size * 1px;
font-size: ~"@{rem}rem";