Regarding to the BEM key concepts:
Blocks can be nested inside any other blocks.
In case, when we are placing one block inside another it's useful to have special class names (Mixes). This class names are responsible for the external geometry and positioning are set via the parent block.
So the block itself should not contain any external geometry and positioning information, because it can be used anywhere.
With current function implementation we can't use mixes. Now, when we are using $blockname variable together with $base_class we will have exactly something like a mixes, but in that case we will lose the block name itself.
Element with modifiers and blockname (optional)
And regarding to the BEM key concepts:
Element is a constituent part of a block that can't be used outside of it.
But the usage of the function described above breaks that main concepts requirements.
Assuming all said I can propose that more proper format to use the function will be something like this:
bem(block_name, (modifiers), mixes_name)
And in that case when we will use something like this:
<h1 {{ bem('title', ['small', 'red'], 'card') }}>
We should get:
<h1 class="title title--small title--red card__title">
Regarding to the BEM key concepts:
In case, when we are placing one block inside another it's useful to have special class names (Mixes). This class names are responsible for the external geometry and positioning are set via the parent block.
So the block itself should not contain any external geometry and positioning information, because it can be used anywhere.
With current function implementation we can't use mixes. Now, when we are using
$blocknamevariable together with$base_classwe will have exactly something like a mixes, but in that case we will lose the block name itself.And regarding to the BEM key concepts:
But the usage of the function described above breaks that main concepts requirements.
Assuming all said I can propose that more proper format to use the function will be something like this:
And in that case when we will use something like this:
We should get: