Created
October 17, 2014 17:35
-
-
Save mirisuzanne/26aced3cc778345843b2 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.4.6) | |
| // Compass (v1.0.1) | |
| // ---- | |
| @function map-append($map, $key, $value) { | |
| @return map-merge($map, ($key: append(map-get($map, $key) or (), $value))); | |
| } | |
| @function parse-expects($expects) { | |
| $map: ( | |
| ); | |
| @each $item in $expects { | |
| @if map-has-key($map, compare) { | |
| $map: map-append($map, expect, $item); | |
| } @else if map-has-key($map, test) | |
| and type-of($item) == string | |
| and str-index($item, 'to ') { | |
| $map: map-append($map, compare, $item); | |
| } @else { | |
| $map: map-append($map, test, $item); | |
| } | |
| } | |
| @return $map; | |
| } | |
| .test { | |
| @each $key, $value in parse-expects(3 - 17 monkeys 'not to be' under the sky) { | |
| #{$key}: $value; | |
| } | |
| } |
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
| .test { | |
| test: -14 monkeys; | |
| compare: "not to be"; | |
| expect: under the sky; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment