Skip to content

Instantly share code, notes, and snippets.

@sashtown
Created May 28, 2014 15:29
Show Gist options
  • Save sashtown/6c39fc222cd272d1ba7c to your computer and use it in GitHub Desktop.
Save sashtown/6c39fc222cd272d1ba7c to your computer and use it in GitHub Desktop.
simple rem/px Sass mixin
html {
font-size: 62.5%; // setting the doc base as 10px = 1.0rem
}
@mixin rem($property, $value) {
#{$property}: $value * 1px;
#{$property}: $value * .1rem;
}
/*
@include rem(font-size, 20);
will output:
font-size: 20px;
font-size: 2.0rem;
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment