Created
May 27, 2014 13:10
-
-
Save RyanRoberts/275ced1c2ce1a3d0d5f0 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
This file contains hidden or 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
| // ---- | |
| // Sass (v3.3.7) | |
| // Compass (v1.0.0.alpha.18) | |
| // ---- | |
| // REM | |
| // | |
| // Modified version of Bitmanic's rem mixin | |
| // See: https://github.com/bitmanic/rem | |
| // ————————————————————————————————————————————————————————————————————————————— | |
| $base-font-size: 10px | |
| =rem($css-property, $values) | |
| // Convert the baseline into rems | |
| $baseline-rem: $base-font-size / 1rem | |
| #{$css-property}: $values | |
| // If there is only one (numeric) value, return the property/value line for it. | |
| @if type-of($values) == "number" | |
| #{$css-property}: $values / $baseline-rem | |
| @else | |
| // Create an empty list that we can dump values into | |
| $rem-values: () | |
| @each $value in $values | |
| // If the value is zero, return 0 | |
| @if $value == 0 or type-of($value) != "number" | |
| $rem-values: append($rem-values, $value) | |
| @else | |
| $rem-values: append($rem-values, $value / $baseline-rem) | |
| // Return the property and its list of converted values | |
| #{$css-property}: $rem-values | |
| h1 | |
| +rem(font-size, 30px) | |
| +rem(width, 200px) | |
| +rem(margin, 20px 0 60px 5px) |
This file contains hidden or 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
| h1 { | |
| font-size: 30px; | |
| font-size: 3rem; | |
| width: 200px; | |
| width: 20rem; | |
| margin: 20px 0 60px 5px; | |
| margin: 2rem 0 6rem 0.5rem; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment