Skip to content

Instantly share code, notes, and snippets.

@benjaminrrrrr
Last active August 29, 2015 14:08
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 benjaminrrrrr/d15dbeedf0e4149bc135 to your computer and use it in GitHub Desktop.
Save benjaminrrrrr/d15dbeedf0e4149bc135 to your computer and use it in GitHub Desktop.
LESS h1...h6 generator with ruleset
//Writing out h1, h2, h3, h4, h5, h6 is for suckerz. Use this less function instead!
.h(@index, @ruleset) when (@index > 0){
h@{index}{
@ruleset();
}
.h(@index - 1, @ruleset);
}
//set color of h1, h2, h3 to red
.h(3, {color: red;});
//set color of h1..h6 to blue
h(6, {color: blue;});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment