Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

rem() is a Sass mixin that converts pixel values to rem values for whatever property is passed to it.

branch: master

This branch is 0 commits ahead and 0 commits behind master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 stylesheets
Octocat-spinner-32 test
Octocat-spinner-32 .gitignore
Octocat-spinner-32 README.mdown
Octocat-spinner-32 Rakefile
README.mdown

rem() is a Sass mixin that converts pixel values to rem values for whatever property is passed to it. It returns two lines of code — one of the regular pixel values (for some older browsers), and another with the converted rem values (for everyone else). Special thanks to Chris Epstein (http://chriseppstein.github.com) and Martin Bavio (http://martinbavio.com) for the help and code!

Sample input:

.element {
  @include rem('padding',10px 0 2px 5px);
}
.element2 {
  @include rem('border', 1px solid red);
  @include rem('padding', 10px !important);
}

Sample output:

.element {
  padding: 10px 0 2px 5px;
  padding: 1rem 0 0.2rem 0.5rem;
}
.element2 {
  border: 1px solid red;
  border: 0.1rem solid red;
  padding: 10px !important;
  padding: 1rem !important;
}
Something went wrong with that request. Please try again.