Sass mixin for rem sizing with IE8 and below fallback using HTML IE conditional stylesheets
$stylesheet: 'style';
@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: 'ie';
@import 'rem-function';
.element {
margin: rem(20);
}