What is the BEM principle?
The Block, Element, Modifier methodology (commonly referred to as BEM) is a popular naming convention for classes in HTML and CSS. Developed by the team at Yandex, its goal is to help developers better understand the relationship between the HTML and CSS in a given project.
Is BEM still used?
BEM is used now in large Russian-language projects (Yandex, Habr) and in several frameworks (react-md).
Why is BEM bad?
Adding bunches of classes and ids with extra symbols in them to markup makes it more difficult to read and deal with. As we know, one of the major complaints of BEM users is its ugliness. It’s also extremely repetitive. This means that using BEM results in much less clean of markup that you’d have in an ideal world.
What is BEM in frontend?
BEM stands for “Block”, “Element”, “Modifier”. It is a front-end methodology: a new way of thinking when developing Web interfaces. This article will elaborate on the theory as well as the practice of building websites at Yandex—one of the leading internet companies in Russia.
What are the benefits of BEM?
Advantages of BEM
- Reusability: Composing independent blocks in different ways and reusing them intelligently reduces the amount of CSS code that you will have to maintain.
- Structure: BEM methodology gives your CSS code a solid structure that remains simple and easy to understand.
- Modularity.
What is BEM in SCSS?
BEM (Block. Element. Modifier) is a naming methodology, which aims to solve many of the problems you’ll commonly encounter when naming classes and structuring your CSS. SASS on the other hand, stands for Syntactically Awesome Style Sheets.
Is BEM obsolete?
Conclusion. BEM is a useful class naming convention to keep gigantic style sheets organisable and readable and to avoid class name collisions. In CDD (component driven development) BEM might be considered obsolete, but a naming convention is still recommended.
Should I use BEM?
Because of its unique naming scheme, we won’t run into conflicts with other CSS names. BEM also provides a relationship between CSS and HTML. Ambiguous names are hard to maintain in the future. Overall, BEM is my favourite CSS naming scheme, and I strongly suggest you try using it too!
Is BEM good for CSS?
BEM (which stands for Block-Element-Modifier) is a naming convention standard for CSS class names. It has fairly wide adoption and is immensely useful in writing CSS that is easier to read, understand, and scale.
How do you do BEM?
A BEM class name includes up to three parts.
- Block: The outermost parent element of the component is defined as the block.
- Element: Inside of the component may be one or more children called elements.
- Modifier: Either a block or element may have a variation signified by a modifier.
What is full form BEM?
BEM – Body Electronics Module.
How do you use BEM?
BEM names intentionally use double underscores and double hyphens instead of single to separate Block-Element-Modifier. The reason is so that single hyphens can be used as word separators. Class names should be very readable, so abbreviation isn’t always desirable unless the abbreviations are universally recognizable.
https://www.youtube.com/watch?v=gk9pUVhWR-I