Answer the question
In order to leave comments, you need to log in
BEM styles in sass - how to do it right?
I write this code in SASS
.main-header
&__navigation-items
padding: 0
margin: 0
list-style: none
&__navigation-item
padding: 10px
margin: 0
display: inline-block
text-transform: uppercase
a
text-decoration: none
color: $text-color
&--active
padding: 10px
margin: 0
display: inline-block
text-transform: uppercase
a
text-decoration: none
color: $main-color
Answer the question
In order to leave comments, you need to log in
In general, BEM assumes the almost complete absence of a cascade. Those. instead of a selector .main-header__navigation-item a
, there should be one .main-header__navigation-link
.
then for
do not apply styles
padding: 10px
margin: 0
display: inline-block
text-transform: uppercase
https://codepen.io/anon/pen/PrKwxJ
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question