Created
February 23, 2015 22:37
-
-
Save jasonkmccoy/f940e07d1578679e2231 to your computer and use it in GitHub Desktop.
Sass List Maps
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
// ---- | |
// libsass (v2.0.0) | |
// ---- | |
@import "sass-list-maps"; | |
/* | |
SASS LIST-MAPS 1.0.0-b3 | |
A polyfill for Sass 3.3.x' "map" data-type, using lists | |
https://github.com/lunelson/sass-list-maps | |
*/ | |
$list-map: ( alpha 1, beta 2, gamma 3 ); | |
$list-map-z: ( | |
alpha ( | |
beta ( | |
gamma 3 | |
) | |
) | |
); | |
.core { | |
/* | |
basic functions | |
*/ | |
map-keys: map-keys($list-map); //-> alpha, beta, gamma | |
map-values: map-values($list-map); //-> 1, 2, 3 | |
map-has-key: map-has-key($list-map, gamma); //-> true | |
map-has-key: map-has-key($list-map, delta); //-> false | |
out: map-get($list-map, alpha); //-> 1 | |
out: map-get($list-map, beta); //-> 2 | |
out: map-get($list-map, gamma); //-> 3 | |
/* | |
advanced and inspection functions | |
*/ | |
out: map-inspect(map-remove($list-map, alpha)); | |
out: map-inspect(map-merge($list-map, gamma 4)); | |
out: map-inspect(map-merge-z($list-map, gamma, 4)); | |
out: map-inspect(map-get-z($list-map-z, alpha)); | |
out: map-inspect(map-get-z($list-map-z, alpha, beta)); | |
out: map-inspect(map-get-z($list-map-z, alpha, beta, gamma)); | |
out: map-pretty(map-merge-z($list-map-z, alpha, beta, delta 4)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Credit: https://github.com/lunelson/sass-list-maps
SassMeister Gist: http://sassmeister.com/gist/4787415116ed1adbc8d9