Skip to content

Instantly share code, notes, and snippets.

@dziedrius
Created May 23, 2014 06:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dziedrius/fbccc76d0f875a66e477 to your computer and use it in GitHub Desktop.
Save dziedrius/fbccc76d0f875a66e477 to your computer and use it in GitHub Desktop.
@grid-columns: 12;
@grid-column-width: 60;
@grid-gutter-width: 20;
@grid-column-padding: 10;
.skip-X (@sub-column-index, @columns) when (@sub-column-index > 0) {
@local-width: (@columns * @grid-column-width) + ((@columns - 1) *
@grid-gutter-width);
@grid-column-width-gutter-width: @grid-column-width + @grid-gutter-width;
(~'[class ~= "skip-@{sub-column-index}"]') {
margin-left: percentage((@sub-column-index *
@grid-column-width-gutter-width + (@grid-gutter-width / 2)) /
@local-width);
}
(~'[class *= "col-"]:first-child[class ~= "skip-@{sub-column-index}"]') {
margin-left: percentage(@sub-column-index *
@grid-column-width-gutter-width / @local-width);
}
.skip-X(@sub-column-index - 1, @columns);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment