Created
March 9, 2015 12:11
-
-
Save onishiweb/c28162e51aa465d8c844 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
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
// ---- | |
// libsass (v3.1.0) | |
// ---- | |
$base-font-size:16px; | |
@mixin rem($property, $px-values, $baseline-px: $base-font-size) { | |
// Convert the baseline into rems | |
$baseline-rem: $baseline-px / 1rem; | |
// Create an empty list that we can dump values into | |
$rem-values: (); | |
@each $value in $px-values { | |
// If the value is zero, return 0 | |
$rem-values: append($rem-values, if($value == 0, $value, $value / $baseline-rem)); | |
} | |
// Output the property's px and rem values | |
#{$property}: $px-values; | |
#{$property}: $rem-values; | |
} | |
body { | |
@include rem('font-size', 14px); | |
} |
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
body { | |
font-size: 14px; | |
font-size: 0.875px/px/rem; } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment