BEM Coding is Simplified With Alternative Syntax Options

BEM Coding is Simplified With Alternative Syntax Options

BEM is a great technique used for organizing code. Without it, your code can become a jumbled cluster of lines that could make it difficult to find what you're looking for. As much as BEM helps to organize your code, it can still be overwhelmingly complex. That's why there are methods to help further simplify this style of syntax. One way is Pleasant BEM, which follows this alternate form of BEM syntax: .BlockName, .BlockName.-modifierName, .BlockName-elementName, and .BlockName-elementName.-modifierName. There are multiple ways that Pleasant BEM further organizes BEM, including media queries and CSS classes. Media Queries
Certain BEMs in programs are meant to be accessed through a particular device. This is why media is represented by capitalized letters: T for the word tablet, M for mobile, D for desktop, and L for large. After a BEM, the media query is written as a hyphen and one or more of the capitalized letters. An example of this is .Hidden-M. You can also add p for plus and m for minus at the end of the line. Another example of this is .-alignLeft-Tp. CSS Classes
Pleasant BEM could also apply to CSS classes that are outside of BEM. Just start the query with a lowercase letter. Predetermined child elements, like li, wouldn't need to be added with Pleasant BEM syntax. It does save more time and energy in having to repeatedly input those elements. There could also be additional convenience if there's a child selector or child positioning by a parent DOM. With these two factors, you wouldn't have to use the name of an element.
Pleasant BEM isn't the only alternative BEM syntax that makes writing code more convenient. The question is whether or not people should use them. There are a lot of different alternatives out there, and individuals may choose to use some, many, or none at all. This can depend on a number of circumstances. A lot of programmers would love to use alternative BEM syntax to further organize and clean up their code. Many others may find it to be more time-consuming and need more required effort to learn and get used to applying a new syntax. Either way, an alternative BEM is worth checking out. For more information click here https://paleo.casa/pleasant-bem.html.

BEM Coding