Created
July 1, 2015 15:32
-
-
Save IainIsCreative/c9e74ae8c6169f7cbcf6 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
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
<p class="output"> | |
The output number is | |
</p> |
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
// ---- | |
// libsass (v3.2.5) | |
// ---- | |
/** | |
* | |
* Is there any way to fetch the last key and a specific key inside it? | |
* | |
**/ | |
$map: ( | |
key-1: ( | |
first: true, | |
number: 1, | |
), | |
key-2: ( | |
first: false, | |
number: 2, | |
), | |
); | |
// Map fetch function by Hugo Giraudel | |
@function map-fetch($map, $keys) { | |
@each $key in $keys { | |
$map: map-get($map, $key); | |
} | |
@return $map; | |
} | |
.output:after { | |
content: '' + map-fetch($map, key-2 number); | |
} |
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
/** | |
* | |
* Is there any way to fetch the last key and a specific key inside it? | |
* | |
**/ | |
.output:after { | |
content: "2"; | |
} |
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
<p class="output"> | |
The output number is | |
</p> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment