Skip to content

Instantly share code, notes, and snippets.

@Webbist-dev
Created December 12, 2014 10:08
Show Gist options
  • Save Webbist-dev/f0cea3e2042284929401 to your computer and use it in GitHub Desktop.
Save Webbist-dev/f0cea3e2042284929401 to your computer and use it in GitHub Desktop.
convert pixel to rem
@function rem($pxval) {
$val: strip-unit($pxval);
$base: strip-unit($browser-default-font-size);
@if ($old-ie == true) {
@return $val * 1px;
}
@else {
@return ($val / $base) * 1rem;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment