Last active
December 16, 2015 19:49
-
-
Save lunelson/5487561 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com, the Sass playground.
This file contains 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
// hack of map/hash functionality, works best with SCSS syntax | |
// works with list of tuples; can accept key-value in either order. | |
@function value($map, $key) { | |
@each $pair in $map { | |
$i: index($pair, $key); | |
@if $i { | |
@return nth($pair, 3 - $i); | |
} | |
} | |
} | |
$test-map: | |
position absolute, | |
bottom 0px, | |
5px right; | |
.test { | |
position: value($test-map, position); | |
bottom: value($test-map, bottom); | |
right: value($test-map, right); | |
} |
This file contains 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 { | |
position: absolute; | |
bottom: 0px; | |
right: 5px; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment