Skip to content

Instantly share code, notes, and snippets.

@seven-phases-max
Created January 23, 2014 12:42
Show Gist options
  • Save seven-phases-max/8577903 to your computer and use it in GitHub Desktop.
Save seven-phases-max/8577903 to your computer and use it in GitHub Desktop.
// ...............
@grid-columns: 5;
@grid-gutter-width: 33px;
// ...............
.col-xs-1,
.col-sm-1,
.col-md-1,
.col-lg-1 {
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 > 1) {
.col((@index - 1));
.col-xs-@{index},
.col-sm-@{index},
.col-md-@{index},
.col-lg-@{index} {
&:extend(.col-xs-1);
}
}
}
// ...............
.make-grid-columns();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment