sass で bem 構文を使用しようとしていますが、問題が発生します。
コードは次のとおりです。
<button name="button" class="button button__call--full">Call</button>
$color__primary : #23ae4b;
$color__secondary : #1976d3;
////////////////////
// Placeholder //
////////////////////
%button {
background: #45beff;
border: none;
padding: 5px 8px;
font-size: 16px;
border-radius:3px;
color:#fff;
&:hover {
opacity: 0.75;
}
}
////////////////////
// Styling //
////////////////////
.button {
@extend %button;
&__call {
box-shadow:
0 0.150em 1px hsl(100, 80%, 30%), 0 0.5em 5px rgba(0, 0, 0, 0.2);
padding:5px 30px;
position: relative;
&--full{
background: url("../../static/images/arrow.png") no-repeat 96% 52% $color__secondary;
}
}
}
私のcssがコンパイルされると、私はこれを持っています:
.button__call {
box-shadow: 0 0.15em 1px #388a0f, 0 0.5em 5px rgba(0, 0, 0, 0.2);
padding: 5px 30px;
position: relative; }
.button__call--full {
background: url("../../static/images/arrow.png") no-repeat 96% 52% #1976d3; }
そして、私はこれが欲しい:
.button__call {
box-shadow: 0 0.15em 1px #388a0f, 0 0.5em 5px rgba(0, 0, 0, 0.2);
padding: 5px 30px;
position: relative; }
.button__call--full {
box-shadow: 0 0.15em 1px #388a0f, 0 0.5em 5px rgba(0, 0, 0, 0.2);
padding: 5px 30px;
position: relative;
background: url("../../static/images/arrow.png") no-repeat 96% 52% #1976d3; }
実際、修飾子がある場合、ブロック ボタンから拡張されます。すべてのスタイル、修飾子、および要素が必要です。私はこれをしたくありません:
<button name="button" class="button button__call button__call--full">Call</button>