Turn on SASS Mixin through another Mixin Value

I have it:

enter image description here

As you can see, I currently have a condition to enable mix buttons in the style of a button, is there anyway I can automatically enable it? For instance:

@mixin button($color)
  @include button-#{$color}
+3
source share
1 answer

Having seen your markup above, I assume that you have already tried interpolation, and it does not work. Just a thought - would it be extend in this context ? those. expand individual mixers button-*with a certain roundness.

$color , , mixin ! , button-blue... button-tree mixins, , $circle?

, , button-blue... button-tree button, , " ifs", ,

@function include-button-mixin($color) {
  @if $color == blue
    @include button-blue
  ...
}
+1

All Articles