-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Impossibility of the Mixes implementation. Breaking general BEM concepts requirements. #10
Comments
Thanks for this Twig extension, my components are now far DRYer. If someone else is interested, these few changes work in my case: |
This is an interesting proposal that we could possibly use a separate argument for like above. And if BEM supports it theoretically, we should allow for it. Just personal preference, in your example above, I wouldn't typically create an element like
This still keeps my styles encapsulated to each component but allows for reusability of styles. Not sure if that helps or is just personal opinion and not applicable. I still think this is worthy of conversation as a topic, so I'm going to leave this open. |
Rounding back to this. I think it would be fair to support BEM mixes, but I'm not a fan of changing the current implementation to automatically assume those. If I use
I don't want it to create
I don't want
So yea, I don't want the implementation to assume that someone would want both |
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
$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.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:
The text was updated successfully, but these errors were encountered: