Created
November 9, 2012 20:18
-
-
Save kevinmarx/4047973 to your computer and use it in GitHub Desktop.
Auto generate pixel fallback when using root-ems
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@mixin use-rems($property, $size1, $size2:null, $size3:null, $size4:null) { | |
@if ($size4) { | |
#{$property}: $size1+px $size2+px $size3+px $size4+px; | |
#{$property}: ($size1/10)+rem ($size2/10)+rem ($size3/10)+rem ($size4/10)+rem; | |
} @else if ($size3) { | |
#{$property}: $size1+px $size2+px $size3+px; | |
#{$property}: ($size1/10)+rem ($size2/10)+rem ($size3/10)+rem; | |
} @else if ($size2) { | |
#{$property}: $size1+px $size2+px; | |
#{$property}: ($size1/10)+rem ($size2/10)+rem; | |
} @else { | |
#{$property}: $size1+px; | |
#{$property}: ($size1/10)+rem; | |
} | |
} |
Also assumes that you are setting your base size to 62.5%
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Requires sass 3.2