I'm running into a bit of an issue with BEM. I have the following:
<ul className="AppHeader__subnav-links">
<li className="AppHeader__subnav-link--active">Details</li>
<li className="AppHeader__subnav-link">Conditions</li>
<li className="AppHeader__subnav-link">Actions</li>
<li className="AppHeader__subnav-link">Assets</li>
</ul>
The idea is that the active link will have an underline beneath it. But the problem is that since BEM classes are all “standalone,” and do not cascade, the AppHeader__subnav-link--active
does not inherit anything from AppHeader__subnav-link
(obviously). Is there a better way for me to structure this? Or do I just have to resort to doing the following:
&__subnav-link {
// properties
&--active {
@extend .AppHeader__subnav-link;
// properties
}
}