私はおそらくあまりにも多くの冗長なものを書いていたため、次のSCSSのミックスインがあります。引数は、カスタマイズのためのすべての側面を申請する単一の値を取る、またはすべての4できるこのSCSSボーダー半径を単純化する方法Mixin? - サス初級
@mixin radius($topleft, $topright: $topleft, $bottomright: $topleft, $bottomleft: $topleft) {
-moz-border-radius-topleft: $topleft;
-moz-border-radius-topright: $topright;
-moz-border-radius-bottomright: $bottomright;
-moz-border-radius-bottomleft: $bottomleft;
-webkit-border-radius: $topleft $topright $bottomright $bottomleft;
border-radius: $topleft $topright $bottomright $bottomleft;
}
注意を。
簡略化宣言を使用し、2つの変数のみを渡す場合は、 '$ bottomleft'変数をデフォルトで' $ topright'に設定する必要があります。 'border-radius:0 3px'は' border-radius:0 3px 0 0'ではなく、 'border-radius:0 3px 0 3px'と等価であるからです。 – inko9nito