Answer the question
In order to leave comments, you need to log in
Is it correct to use the modifier like this?
I'm using BEM (trying) to name classes, by Gallocher:
.block
.block__elem
.block__elem--modif
I don't quite understand how to use blocks on different pages using a modifier.
For example, I have a .form pop-up form
I need to use a modified version of it on another page.
I can just give it a class "form form--on-page"
And style it like this
Or is this the wrong way?
Answer the question
In order to leave comments, you need to log in
Yes that's right. The only thing I would recommend is to think about the format of class names. Using double dashes and double underscores doesn't seem like the best idea to me. It looks very cumbersome, especially when one element has several similar classes.
.block__elem {}
.block__elem--modif {}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question