Created
June 23, 2015 12:12
-
-
Save seven-phases-max/b13400c1aeed8bc45448 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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