Last active
December 17, 2019 13:05
-
-
Save kaspar-allenbach/7be21ebd592508aeff74f5208238be32 to your computer and use it in GitHub Desktop.
scss grid offset loop
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
// ---- | |
// Sass (vundefined) | |
// Compass (vundefined) | |
// dart-sass (v1.18.0) | |
// ---- | |
$gridBaseNumber: 12; | |
//make span grid column classes | |
@for $i from 1 through $gridBaseNumber { | |
$spanVar: $i; | |
//generate all span classes | |
.widthSpan#{$i} { | |
grid-column: span $spanVar; | |
//within the span loop create all offset loops for each span option | |
@for $i from 1 through $gridBaseNumber { | |
$offsetVar: $i; | |
&.widthOffset#{$offsetVar} { | |
grid-column: $i #{"/"} span $spanVar; | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment