Answer the question
In order to leave comments, you need to log in
CSS: what about the grid?
The question is: should the grid styles be written as individual component styles (like the grid in bootstrap, for example) or is it better to write styles separately for each component?
Example: there is a header that consists of three sections: brand, navigation, actions.
If we write separate styles for the grid, the layout might look like this:
<header class="header">
<div class="container">
<div class="row">
<div class="header__brand col-2">
<a href="#">Brand</a>
</div>
<div class="header__menu col-8">
<ul>
<li><a href="#">Item</a></li>
</ul>
</div>
<div class="header__actions col-2">
</div>
</div>
</div>
</header>
<header class="header">
<div class="header__container">
<div class="header__brand">
<a href="#">Brand</a>
</div>
<div class="header__menu">
<ul>
<li><a href="#">Item</a></li>
</ul>
</div>
<div class="header__actions">
</div>
</div>
</header>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question