Answer the question
In order to leave comments, you need to log in
BEM improvement or "unnecessary"?
I've been typing in BEM for over a year now. There is no point in talking about the merits of this methodology (I generally believe that it should be accepted by everyone as a standard in layout :). I want to draw attention to one annoying feature - verbosity. This is especially true for modifiers.
For example, here is a piece of normal markup - there is a row component with columns ("_c-row"), there are child elements ("__col"), and modifiers that change their size depending on the screen size ("--md-2-2")
<div class="_c-row">
<div class="_c-row__col--1-2 _c-row__col--md-2-2">1</div>
<div class="_c-row">
<div class="_c-row__col _c-row__col--mobile-1-2 _c-row__col--tablet-2-2">1</div>
<div class="_c-row">
<div class="_c-row__col --mobile-1-2 --tablet-2-2">1</div>
Answer the question
In order to leave comments, you need to log in
The essence of BEM is not only in this naming, but also in the fact that you can take any block at any time, in any combination, and move it to another place and everything will work. No conflicts, no name collisions, no scope dependencies. This is his strength.
Well, the redundancy of the description is easily corrected by the assembly tools, which themselves will collect all these long names.
What you propose, of course, also has the right to exist. Use in your projects if it suits you.
This approach is called: "modifiers via extend."
If you do not write HTML by hand, this question becomes meaningless.
There is a risk of slipping into an imperative description of modifier names.
Increases the necessary qualifications of a specialist, in the practice of this approach, the need to understand "what I am doing and what the consequences may be" becomes especially critical.
There are practices of this campaign https://twitter.com/ihorzenich/status/776395453533...
This issue is periodically discussed
on the BEM forum , you need to search.
I don't think there can be a clear answer to this question.
so why not separate the --1-2 and --md-2-2 modifiers from the component name?
maybe I misunderstood something, because your hyphens make your eyes run wide ... Semantics is still such a concept, by the way. But, how does your proposal differ from the concept of bem primisi?
And who is writing with his hands in 2017? Go google about pug and sass and how to assemble this whole story with gulp or webpack.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question