Our flavor of BEM
Our flavor of BEM selectors :
If you read the docs you have seen that ther is not one convention but many.
The one that we will use is the following :
To summarize:
We need a prefix symbolized by
.pr-
hereWords are separated by a
-
in a kebab case fashionElement entity is preceded by two low dashes
__element-name
Modifiers are separated by two 'middle' dashes
--modifier-name
For now, don't care about the prefix .pr-
part, it will be explained later, in the BEMIT related page of this doc.
Syntactic sugar with SCSS
With SCSS we use the &
to call the parent selector name and add the required BEM entity at the end :
If you ask me, typing less is always cool, but the coolest part is that it create this kind of nesting structure that illustrate even more the relationship between the different entities.
Last updated