Created
February 16, 2014 23:41
-
-
Save mturjak/9042283 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.3.0.rc.4) | |
| // Compass (v1.0.0.alpha.18) | |
| // ---- | |
| //recursive match function | |
| @function recumatch($l, $a){ | |
| @each $e in $l { | |
| @if type-of($e) != 'list' { | |
| @if $e == $a { @return true; } | |
| } | |
| @else { | |
| @if recumatch($e, $a) { @return true; } | |
| } | |
| } | |
| @return false; | |
| } | |
| test { | |
| //multidimensional list: | |
| $list: (('a', ('f', 'b')), 'c'), 'd'; | |
| test1: recumatch($list, 'b'); | |
| test2: recumatch($list, 'g'); | |
| } |
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 { | |
| test1: true; | |
| test2: false; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment