by bjornsteffanson · 12y ago · 0 comments
Your CSS could easily be shortened to:
.body {
@extend .container;
}
.nav-header {
@extend .row;
}
.my-logo {
@extend .col-sm-2;
}
And your markup could be much cleaner: <body>
<nav class="nav-header">
<div class="my-logo">
<!-- your stuff -->
</div>
</nav>
</body>Still, your final output produces three levels of DOM, which was exactly what my point was. No matter how much you try to export your grid code into your CSS (and you should try!), you will always run into situations where you need that <div class="row"> and there will be no way to semantically handle that.
Furthermore, there are some limitations even when combining semantic elements that cause issues. For instance, I often write this code:
<div class="row well">
To find that the exact margin/padding values I want for my well interfere with the default padding/margin values provided by row defaults. In those cases, I almost always have to add an additional DOM level and separate my classes to achieve my effect.