Skip to content

Instantly share code, notes, and snippets.

@esteinborn
Created January 28, 2014 18:03
Show Gist options
  • Save esteinborn/8672878 to your computer and use it in GitHub Desktop.
Save esteinborn/8672878 to your computer and use it in GitHub Desktop.
Rem Fallback
/* Set up a variable for maths */
$doc-font-size: 16;
/* the font-size mixin */
@mixin font-size($size) {
font-size: 0px + $size;
font-size: 0rem + $size / $doc-font-size;
}
/* example of usage */
.prose p {
@include font-size(16);
}
/* example compiled */
.prose p {
font-size: 16px;
font-size: 1rem;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment