Skip to content

Instantly share code, notes, and snippets.

@ddprrt
Last active August 29, 2015 14:08
Show Gist options
  • Save ddprrt/a061e0a8bb01f4dd3389 to your computer and use it in GitHub Desktop.
Save ddprrt/a061e0a8bb01f4dd3389 to your computer and use it in GitHub Desktop.
A Lessig File
// Normal
.create-buffer(@n: 10) {
.width-@{n} {
width: @n * 1px;
}
@m1: @n*2;
.width-@{m1} {
width: @m2 * 1px;
}
@m2: @n*3;
.width-@{m2} {
width: @m2 * 1px;
}
@m3: @n*4;
.width-@{m3} {
width: @m3 * 1px;
}
@m4: @n*5;
.width-@{m4} {
width: @m4 * 1px;
}
}
.create-buffer();
// Loop
.create-buffer-loop(@n: 10, @idx: 1) when (@idx < 6) {
@m: @n * @idx;
.width-loop-@{m} {
width: @m * 1px;
}
.create-buffer-loop(@n, @idx+1);
}
.create-buffer-loop();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment