Created
November 12, 2013 04:19
-
-
Save patelprashant/7425418 to your computer and use it in GitHub Desktop.
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
| // To simulate associative arrays | |
| // Source: http://hugogiraudel.com/2013/08/12/sass-functions/#mapping | |
| @function match($haystack, $needle) { | |
| @each $item in $haystack { | |
| $index: index($item, $needle); | |
| @if $index { | |
| $return: if($index == 1, 2, $index); | |
| @return nth($item, $return); | |
| } | |
| } | |
| @return false; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment