Created
January 3, 2014 06:08
-
-
Save BronsonQuick/8233624 to your computer and use it in GitHub Desktop.
A Sass mixin for rems & a pixel fallback for < IE8 and Opera Mini
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 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 */ | |
h3 { | |
@include font-size(16); | |
} | |
/* example compiled */ | |
h3 { | |
font-size: 16px; | |
font-size: 1rem; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment