Skip to content

Instantly share code, notes, and snippets.

@fat
Created February 28, 2012 17:44
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 fat/1933910 to your computer and use it in GitHub Desktop.
Save fat/1933910 to your computer and use it in GitHub Desktop.
Looping using Recursive Guards in LESS
.spanX (@gridColumns) when (@gridColumns = 0) {}
.spanX (@gridColumns) when not (@gridColumns = 0) {
.span1 { .span(@gridColumns); } // need to find out a way to change .span1 into ".span@{gridcolumns}"
#grid .spanX(@gridColumns - 1);
}
.spanX(12); // this actually works
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment