Skip to content

Instantly share code, notes, and snippets.

@xyos
Created August 4, 2015 05:05
Show Gist options
  • Save xyos/d5b024be88919988b180 to your computer and use it in GitHub Desktop.
Save xyos/d5b024be88919988b180 to your computer and use it in GitHub Desktop.
.generate-columns(59);
.generate-rows(23);
.generate-columns(@n, @i: 1) when (@i =< @n) {
.un-col-@{i} {
width: (@i * 100vw / @n);
}
.un-col-offset@{i} {
margin-left: (@i * 100vw / @n);
}
.generate-columns(@n, (@i + 1));
}
.generate-rows(@n, @i: 1) when (@i =< @n) {
.un-row-@{i} {
width: (@i * 100vh / @n);
}
.un-row-offset@{i} {
margin-top: (@i * 100vh / @n);
}
.generate-rows(@n, (@i + 1));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment