Last active
July 25, 2017 10:20
-
-
Save gisu/568cf870d8860fbd0ec1225a05122c4e to your computer and use it in GitHub Desktop.
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
/// Generate a Grid Template Area from a Grid Map | |
/// | |
/// @group core - cssgrid | |
/// | |
/// @param {string} $area - Name of the Area | |
/// @param {map} $map - Map of your grid area matrix | |
/// | |
/// @example scss - scss | |
/// $gridAreaMap: ( | |
/// row1: ('logo', 'nav', 'nav', 'nav'), | |
/// row2: ('logo', 'empty', 'search', 'search') | |
/// ); | |
/// @include grid-matrix($gridAreaMap); | |
@mixin grid-matrix($map) { | |
$matrix: (); | |
@each $index, $row in $map { | |
$list: null; | |
@for $i from 1 through length($row) { | |
$list: append($list, unquote(nth(($row), $i)), space); | |
} | |
$matrix: append($matrix, quote($list), space); | |
} | |
grid-template-areas: $matrix; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment