S
S
smogstart2020-07-20 15:51:36
BEM
smogstart, 2020-07-20 15:51:36

Modifier, mix or block wrapper for margins?

The navigation has a different margin-left in different places on the site. How to correctly set the outer margin? With a wrapper block, mixin, or modifier?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
F
FabiBoom, 2020-07-20
@FabiBoom

It's better to mix.

<header class="site-header">
    <nav class="site-header__nav nav"></nav>
</header>

<footer class="site-footer">
    <div class="site-footer__nav nav"></div>
</footer>

.site-header__nav {
   margin-left: 25px;
}
/* ... */
.site-footer__nav {
   margin-left: 15px;
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question