Skip to content

Instantly share code, notes, and snippets.

@seven-phases-max
Last active January 2, 2016 15:39
Show Gist options
  • Save seven-phases-max/8324997 to your computer and use it in GitHub Desktop.
Save seven-phases-max/8324997 to your computer and use it in GitHub Desktop.
// ...............
@grid-columns: 3;
@grid-gutter-width: 33px;
// ...............
.grid-column-template { // Ok, the cons: this creates a dummy class in the output
position: relative;
// Prevent columns from collapsing when empty
min-height: 1px;
// Inner gutter via padding
padding-left: (@grid-gutter-width / 2);
padding-right: (@grid-gutter-width / 2);
}
.make-grid-columns() {
.col(); // kickstart it
.col(@index: @grid-columns) when (@index > 0) {
.col((@index - 1));
.col-xs-@{index},
.col-sm-@{index},
.col-md-@{index},
.col-lg-@{index} {
&:extend(.grid-column-template);
}
}
}
// ...............
.make-grid-columns();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment