Keyword arguments in mixins

To make mixins more clear when working in big project it is wise to specify a keyword.Then it doesn’t matter in which order you pass in the arguments.

@mixin assemble($bg: #fff, $pad: 10px) {
  background: $bg;
  border: 1px solid #ccc;
  padding: $pad;
}

.factory {
  @include assemble();
}
.highrise {
  @include assemble($bg: #797979, $pad: 20px);
}

Add your comment