.green-oval-button {
@extend .oval-button;
@include radial-gradient($green-gradient...);
&:active {
@include radial-gradient($green-gradient-active...);
}
}
.blue-oval-button {
@extend .oval-button;
@include radial-gradient($blue-gradient...);
&:active {
@include radial-gradient($blue-gradient-active...);
}
}
SassScripts
上記をMixin
++で単純化することは可能Interpolation
ですVariable Arguments
か?
例:エラーになった
@mixin color-oval-button($color) {
@extend .oval-button;
@include radial-gradient(#{$color}-gradient...);
&:active {
@include radial-gradient(#{$color}-gradient...);
}
}
@include color-oval-button("$green");
@include color-oval-button("$blue");