Skip to content

Instantly share code, notes, and snippets.

@paulfarino
Created July 11, 2017 21:59
Show Gist options
  • Save paulfarino/4a39811dd4d92df51bf84cb22ccead23 to your computer and use it in GitHub Desktop.
Save paulfarino/4a39811dd4d92df51bf84cb22ccead23 to your computer and use it in GitHub Desktop.
CSS Grid Loop πŸŒ€
$gtc: grid-template-columns;
$gtr: grid-template-rows;
$gcs: grid-column-start;
$gce: grid-column-end;
$grs: grid-row-start;
$gre: grid-row-end;
$gridOptions: (
("gtc", $gtc),
("gtr", $gtr),
("gcs", $gcs),
("gce", $gce),
("grs", $grs),
("gre", $gre)
);
@each $gridOptions, $gridValue in $gridOptions {
@for $number from 1 through 12 {
.#{$gridOptions}-#{$number}{
#{$gridValue}: $number;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment