Skip to content

Instantly share code, notes, and snippets.

@onishiweb
Created March 9, 2015 12:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save onishiweb/c28162e51aa465d8c844 to your computer and use it in GitHub Desktop.
Save onishiweb/c28162e51aa465d8c844 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
// ----
// 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);
}
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