I have the following BSS BEM style to define a simple window:
.box { } .box__heading {} .box__image { }
I also need to show the window in error mode, so I defined the following modifier:
.box--error {}
The problem I ran into is finding a good way to define styles for nested elements like box__heading when the field is in error mode.
I also define modifiers for both the header and the parent:
<div class="box box--error"> <h2 class="box__heading box__heading--error"></h2> </div>
or am I just doing this in css:
.box--error {} .box--error .box__heading { }
source share