Created
January 25, 2014 10:38
-
-
Save mturjak/8614579 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.2) | |
| // Compass (v1.0.0.alpha.17) | |
| // ---- | |
| $a: 1 2 3 4; | |
| $b: 2 3 4; | |
| @function matrix($a, $b) { | |
| $c: (); | |
| @each $i in $a { | |
| $c: append( $c, if( | |
| type-of($b)=="list", | |
| matrix($b, $i), | |
| $i * $b | |
| )); | |
| } | |
| @return $c; | |
| } | |
| // matrix test print | |
| @mixin print_matrix($m) { | |
| #matrix-test { | |
| @for $i from 1 through length($m) { | |
| l#{$i}: nth($m,$i); | |
| } | |
| } | |
| } | |
| $c: matrix($a, $b); | |
| @include print_matrix($c); |
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
| #matrix-test { | |
| l1: 2 3 4; | |
| l2: 4 6 8; | |
| l3: 6 9 12; | |
| l4: 8 12 16; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment