Created
April 25, 2014 15:27
-
-
Save timeinfeldt/11293500 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.5) | |
| // Compass (v1.0.0.alpha.18) | |
| // ---- | |
| $map:(); | |
| $values: (text-s 12px), (text-m 14px), (text-l 16px); | |
| // generate classes from $values | |
| @each $item in $values { | |
| .#{nth($item, 1)} { | |
| font-size: nth($item, 2); | |
| } | |
| } | |
| // generate silent classes from $values | |
| @each $item in $values { | |
| %#{nth($item, 1)} { | |
| font-size: nth($item, 2); | |
| } | |
| } | |
| // fill map from $values | |
| @each $item in $values { | |
| $map: map-merge($map, (nth($item, 1): nth($item, 2))); | |
| } | |
| // use one of the generated silent classes | |
| .using-extend { | |
| @extend %text-l; | |
| } | |
| @function get($key) { | |
| @return map-get($map, $key); | |
| } | |
| .using-map { | |
| //font-size: map-get($map,text-l); | |
| font-size: get(text-l); | |
| } |
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
| .text-s { | |
| font-size: 12px; | |
| } | |
| .text-m { | |
| font-size: 14px; | |
| } | |
| .text-l { | |
| font-size: 16px; | |
| } | |
| .using-extend { | |
| font-size: 16px; | |
| } | |
| .using-map { | |
| font-size: 16px; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment