@mixin rem($property, $px, $base: 16px) { // Convert the baseline into rems $rem: $base / 1rem; // Print the first line in pixel values #{$property}: $px; // If there is only one (numeric) value, return the property/value line for it. @if type-of($px) == "number" { #{$property}: $px / $rem; } @else { // Create an empty list that we can dump values into $rem-values: unquote(""); @each $value in $px { // If the value is zero, return 0 @if $value == 0 { $rem-values: append($rem-values, $value); } @else { $rem-values: append($rem-values, $value / $rem); } } // Return the property and its list of converted values #{$property}: $rem-values; } }