Created
December 5, 2014 07:52
-
-
Save maxxscho/5b8d6b87cfbc128ef87f to your computer and use it in GitHub Desktop.
Font size mixin for rem values with pixel fallback for old browsers
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
// REM output based on the $em-base variable with pixel fallback | |
@mixin font-size($pxVal) { | |
@if not unitless($pxVal) { | |
$pxVal: strip-unit($pxVal); | |
} | |
font-size: $pxVal * 1px; | |
font-size: rem($pxVal); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment