I am trying to learn mixin's with SCSS, I am trying to make a simple mixin to control the style of buttons, however it is not working.
I am sure I have missed something obvious, but I am pulling my hair out now.
Any advice would be much appreciated.
As you can see here - my mixin is not being applied.
html
<div class="button-collection">
<button type="button"
class="button-collection__button button-collection__button--is-blue">
Button One
</button>
<button type="button"
class="button-collection__button button-collection__button--is-pink">
Button Two
</button>
@mixin button($primary) {
background-color: $primary;
}
.button-collection__button {
display: block;
width: 400px;
height: 40px;
margin: 10px auto;
&.--is-blue {
@include button(#449dc7);
height: 400px;
}
}