Navngitte parametre for mixins i SASS

I mixins kan man angi navngitte parametre. La oss se på dette med følgende eksempel:

styles.scss@mixin active($color) {
  border: {
    color: $color;
    style: solid;
  }
}
p {
  @include active($color: orange);
}
div {
  @include active($color: green);
}

Resultatet av kompilering:

styles.cssp {
  border-color: orange;
  border-style: solid;
}
div {
  border-color: green;
  border-style: solid;
}

I tillegg kan man sende standardverdier til parametre i mixins:

styles.scss@mixin active($color,  $width: 2px) {
  border: {
    color: $color;
    width: $width;
    style: dotted;
  }
}
p {
  @include active(yellow);
}
div {
  @include active(yellow, 4px);
}

Etter kompilering vil vi se:

styles.cssp {
  border-color: yellow;
  border-width: 2px;
  border-style: dotted;
}
div {
  border-color: yellow;
  border-width: 4px;
  border-style: dotted;
}
Задание 1

Fortell hva som blir resultatet av kompilering av følgende kode:

styles.scss@mixin super-button($color, $background-color, $border-radius) {
  color: $color;
  background-color: $background-color;
  border-radius: $border-radius;
}
.active-button {
  @include super-button($color: white,  $background-color: red, $border-radius: 2px);
}          
Задание 2

Fortell hva som blir resultatet av kompilering av følgende kode:

styles.scss@mixin super-button($color, $background-color, $border-radius: 5px) {
  color: $color;
  background-color: $background-color;
  border-radius: $border-radius;
}
.active-button {
  @include super-button($color: white,  $background-color: red);
}
Задание 3

Fortell hva som blir resultatet av kompilering av følgende kode:

styles.scss@mixin super-button($color, $background-color: orange, $border-radius: 5px) {
  color: $color;
  background-color: $background-color;
  border-radius: $border-radius;
}
.active-button {
  @include super-button($color: white, $border-radius:3px);
}