Answer the question
In order to leave comments, you need to log in
What is the difference between a mix and a modifier in this BEM example?
There is a menu, in the header and in the footer, depending on where it is located, you need an indent from the parent 20px or 40px. In both cases, this is done by extending the common (universal) class selector. BUT what's the difference?
/////////////////////////////////////////////////// /////////////////////////////////////////////////// ////////
Answer the question
In order to leave comments, you need to log in
From a vanilla CSS point of view, there is no difference, you just add extra functionality by adding a class.
In terms of reading styles, there is a difference in where you describe what you want to achieve - in the first case (modifier) the changes are described in the component itself, in the second (mix) the changes are described in the parent component (header, footer).
In your case, you should use only the mix, using a modifier will be a mistake, because:
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question