Skip to content

Instantly share code, notes, and snippets.

@JTLR
Created February 13, 2014 22:26
Show Gist options
  • Save JTLR/8985230 to your computer and use it in GitHub Desktop.
Save JTLR/8985230 to your computer and use it in GitHub Desktop.
Sass mixin for rem sizing with IE8 and below fallback using HTML IE conditional stylesheets
$stylesheet: 'ie';
@import 'rem-function';
.element {
margin: rem(20);
}
$base-font-size: 16;
@function rem ($pixels) {
@if $stylesheet == 'ie' {
@return $pixels + px;
}
else {
@return ($pixels / $base-font-size) + rem;
}
}
$stylesheet: 'style';
@import 'rem-function';
.element {
margin: rem(20);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment