Skip to content

Instantly share code, notes, and snippets.

@d13 d13/1-source.less
Last active Aug 29, 2015

Embed
What would you like to do?
LESS and BEM experiment
#BEM {
.glue(@glue, @selector, @styles) {
&@{glue}@{selector} {
@styles();
}
}
.e(@name, @styles) {
#BEM > .glue(__, @name, @styles);
}
.m(@name, @styles) {
#BEM > .glue(--, @name, @styles);
}
}
.my-block {
#BEM > .m(~'red', {
color: red;
});
#BEM > .e(~'link', {
color: green;
#BEM > .m(~'blue', {
color: blue;
});
});
}
.my-block--red {
color: red;
}
.my-block__link {
color: green;
}
.my-block__link--blue {
color: blue;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.