Answer the question
In order to leave comments, you need to log in
What is the best way to type?
In general, I type according to the bem methodology, I split the project into blocks as much as possible and this is how they look:
That is, my entire project consists of pug + scss, and I connect these blocks where necessary. But all this began to bother me, although I wrote a cli that generates all the files, there is still a feeling that I am only complicating my work.
You also need to add classes to these blocks from the outside, and damn you write this all the time:
mixin button()
.button(class=attributes.class) //- (class=attributes.class) Вот такое к каждому блоку к которому нужно добавлять класс
Answer the question
In order to leave comments, you need to log in
This is a big complication, besides the fact that it takes you a lot of time to create a block, it will take even more time to change, and it will take a hundred years to assemble it. Instead of BEM, there are CSS selectors, and instead of PUG, manual changes.
If it is critical for you to have such a strict naming structure and you cannot use selectors for some reason and want to fence giant classes in html, then you need BEM. And if you still have instances of one block on a couple of dozen pages that you need to change only in one (very conditionally one, if you have a generation from an array, for example, then nifiga is not in one place), then you also need PUG)
In general, I would not complicate If I were you
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question