Skip to content

Instantly share code, notes, and snippets.

@seven-phases-max
Created June 23, 2015 12:12
Show Gist options
  • Save seven-phases-max/b13400c1aeed8bc45448 to your computer and use it in GitHub Desktop.
Save seven-phases-max/b13400c1aeed8bc45448 to your computer and use it in GitHub Desktop.
// usage:
.button {
.lib.button(A);
}
.button {
.lib.button(--compact, B);
}
// impl:
.lib {
.button(@subclass, @x) {
&@{subclass} {style: @x}
&@{subclass} > &-text {text-style: @x}
}
// a syntactic-sugar for the empty subclass.
// *if* there're some optional args in the base mixin you'll
// need some condition here or there like `iskeyword(@subclass)` or so:
.button(@x) {.lib.button(~'', @x)}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment