Answer the question
In order to leave comments, you need to log in
How to mark up the internal pages of the site from the BEM point of view?
How to mark up the internal pages of the site from the BEM point of view?
Do I need to indicate everywhere what this page is? For example inner-page__services or price-page__quality-assurance
Let's say I have an internal page of the site, the section of which, in principle, can be described as services . There is a list of services and prices for them, as well as a list of branded products, which guarantees the quality of the services provided.
But as usual, services flickers somewhere on the main landing page. And then I hit a dead end. After all , servicesthis block, which can be repeated on other pages of the site, and at the same time, will look different. In my case, there is no such section on the main page. But, nothing prevents him from appearing there, over time.
Of course, if you follow BEM completely, the same file structure should appear. But if I need to cram all the styles into one css? Then, is it worth somehow highlighting the content of internal pages? Or should repetition in class naming be avoided?
Answer the question
In order to leave comments, you need to log in
Structure for all pages:
.page
.page__header
.header
.page__wrapper
.page__block1
.block1 // это блок страницы, замените на свое название
.page__block2
.block2
.page__footer
.footer
Do I need to indicate everywhere what this page is?
After all, services is a block that can be repeated on other pages of the site, and at the same time, it will look different.
Of course, if you follow BEM completely, the same file structure should appear. But if I need to cram all the styles into one css?
Or should repetition in class naming be avoided?
After all, services is a block that can be repeated on other pages of the site, and at the same time, it will look different
services
and you want to use it on the main page and on any other page, then the naming of this block on the main page will be like this - where you describe the location of the elements inside the block for the main page class="main__services services"
using the selector . Now you can do the same for another pagemain__services
services
class="another-page__services services"
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question