Skip to content

Instantly share code, notes, and snippets.

@hlynx
Last active February 15, 2018 08:36
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 hlynx/8d4bcc4e985b839daa42bf85ccbc3412 to your computer and use it in GitHub Desktop.
Save hlynx/8d4bcc4e985b839daa42bf85ccbc3412 to your computer and use it in GitHub Desktop.
Simplifies markup a lot
@margins: 0, 5, 10, 15, 20, 30, 40, 50, 60, 70, 80;
.margin-mixin();
.margin-mixin(@i: length(@margins)) when (@i > 0) {
.margin-mixin(@i - 1);
@margin: extract(@margins, @i);
.margin-@{margin} {
margin-bottom: ~"@{margin}px";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment