3 ms·
What's the motivation to pick .navbar { &__element { &__hover { ... } } } over .navbar__element__hover { ... } ?
by emn13 11y ago
What's the motivation to pick
.navbar { &__element { &__hover { ... } } }
over
.navbar__element__hover { ... }
?
- blowski 11y agoAssuming that .navbar contains lots of elements, and those elements have lots of modifiers, then repeatedly writing .navbar__ is not very DRY. Want to change .navbar to .primary-navbar? You have to change it for every selector in that block.
- marrs 11y agoI would actually argue that DRYness is to be avoided in this case. How many selectors you are specifying, and what they are, is something you should be explicitly aware of. You may find that your DRY SASS is producing very non-DRY CSS.