Using a Block inside another Block #298
Unanswered
dotnetCarpenter
asked this question in
Q&A
Replies: 1 comment
-
Actually https://en.bem.info/methodology/css/#mixes suggest that the former solution with duplicated Elements is the preferred choice. Not sure why? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm not seeing this answered in the FAQ, so here goes.
Let's say we have progress bar. It is coded up as stand-alone BEM. But can be used inside other Blocks. What is the naming convention here?
Now we have another Block,
f-thumbnail
, that needs to use af-progress
but also need to tweak it to the new context.Do you duplicate the Elements names as seen below?
Or do you add a Modifier to
f-progress
so that it fits in the new context?I believe the last solution is the better one but we're using the former. I don't see an authoritative explanation on getbem.com.
Final bonus question, should the Modifier,
f-progress--thumbnail
live in the f-progress.css file or in f-thumbnail.css?PS. Similar but not quite Q/A's
Beta Was this translation helpful? Give feedback.
All reactions