Skip to content

Instantly share code, notes, and snippets.

@maxxscho
Created December 5, 2014 07:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maxxscho/5b8d6b87cfbc128ef87f to your computer and use it in GitHub Desktop.
Save maxxscho/5b8d6b87cfbc128ef87f to your computer and use it in GitHub Desktop.
Font size mixin for rem values with pixel fallback for old browsers
// 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