B
B
BB 82018-06-29 17:58:01
css
BB 8, 2018-06-29 17:58:01

How to make BEM and WP friends?

Good evening! I work in a team, a teammate who writes on WP complains that when everything is hung up on classes, it's bad:

<section class="sec1">
 <h1 class="title title_black">
 <p class="text text_with_some_css_style">
</section>

Says it needs to be like this:
<section class="awesomeClass">
 <h1>
<p>
</section>

.awesomeClass h1
.awesomeClass p

This is an oversimplified version, because having more than 40-50 pages in the project, everything results in............ Offers to tie everything to 1 class and foresee possible variations in advance: i.e. if in the second case UL is also inserted into the section, then it must be styled in advance in css: What if paragraphs or the same lists differ inside the section ?? Do like this:
.awesomeClass ul
.someClass1 ul:first-child
.someClass1 ul:nth-child(2)

?????????????????????????????????

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir Proskurin, 2018-06-29
@fruity4pie

Well, in general, almost all things in WP, widgets, menus, etc., you can change the template for all of them and there will be no problems.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question