Skip to content

Instantly share code, notes, and snippets.

@seven-phases-max
Last active August 29, 2015 13:55
Show Gist options
  • Save seven-phases-max/8697735 to your computer and use it in GitHub Desktop.
Save seven-phases-max/8697735 to your computer and use it in GitHub Desktop.
@import "for"; // see https://github.com/seven-phases-max/less.curious/blob/master/src/for.less
.map(@property, @class-value-list...) {
.for(@class-value-list); .-each(@value) {
@class: extract(@value, 1);
.@{class} {@{property}: extract(@value, 2)}
}
}
// usage:
.map(background-position;
class-1, 100px 50px;
class-2, 200px 150px;
class-3, 300px 250px);
.map(color; foo red, bar green, baz blue);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment