Skip to content

Instantly share code, notes, and snippets.

@teknotica
Last active September 13, 2018 16:50
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 teknotica/5f0faf632ee0c8282f42 to your computer and use it in GitHub Desktop.
Save teknotica/5f0faf632ee0c8282f42 to your computer and use it in GitHub Desktop.
LESS loop
@bulletcolours:
black @color-black,
blue @color-blue,
red @color-red,
green @color-green,
yellow @color-yellow,
navy @color-navy,
orange @color-orange,
grey @color-grey;
.coloursBulletSelectors (@i) when (@i > 0) {
@item: extract(@bulletcolours, @i);
@label: extract(@item, 1);
@colour: extract(@item, 2);
&.circles-@{label} {
li:before {
padding: 10px;
background-color: @colour;
}
}
.coloursBulletSelectors((@i - 1));
}
.coloursBulletSelectors( length(@bulletcolours) );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment