Let's say I want to have a title
block, and for styling considerations I need to nest it inside a div
with some special CSS styling (e.g. I want specific border and spacing styling). Let's call this one box
. The box just serves the style the title
inside it.
The fact I need to have box
at all just has to do with the limitations of CSS, so it doesn't make sense for the box
to be considered a block in BEM terminology. It doesn't even make sense as a DOM element. But title
is located inside box
.
It makes sense to me to give box
the class title__box
because it doesn't make sense without title
. However, all examples of BEM seem to assume the element is always a DOM child of the block it's in.