Note: Some of these only make sense if you read them in order, because they build on the previous.
<div class="PriceWidget">
<button class="PriceWidget-submit Button">Recalculate</button>
</div>
<div class="PriceWidget">
<div class="PriceWidget-submit">
<button class="Button">Recalculate</button>
</div>
</div>
OR
<div class="PriceWidget">
<button class="Button Button--recalculate">Recalculate</button>
</div>
<div class="PriceWidget PriceWidget-submit">
<button class="Button">Recalculate</button>
</div>
<div class="PriceWidget">
<div class="PriceWidget-submit">
<button class="Button">Recalculate</button>
</div>
</div>
.Button {
width: 60px;
}
.PriceWidget-submit { // wraps the button
width: 60px;
}
.Button {
margin-left: 10px;
}
.PriceWidget-submit { // wraps the button
padding-left: 10px;
}
While css-bliss doesn't explicitly prohibit doing this, it should generally be avoided. Whenever you find yourself utilizing width
on a Module Modifier, consider applying width
to the parent element instead.
.Button--width60px {
width: 60px;
}
.PriceWidget-submit { // wraps the button
width: 60px;
}
While css-bliss doesn't explicitly prohibit doing this, it should generally be avoided. Overuse of margin is bad for modularity. Whenever you find yourself utilizing margin
, consider using padding
on the parent element instead.
.Button--margin10px {
margin: 10px 0;
}
.PriceWidget-submit { // wraps the button
padding: 10px 0;
}