Can blocks have other blocks as children, or only elements are allowed? #225
Answered
by
floatdrop
andrejesuscm
asked this question in
Q&A
|
Imagine the following component: Is it allowed to have another block Thanks for the clarification. |
Answered by
floatdrop
Sep 17, 2022
Replies: 2 comments
|
If |
0 replies
Answer selected by
floatdrop
|
It can combine element and block in one DOM node, more of it - has not do it. Rule of thumb - every block is an element. As usual Block cannot specify own dimensions and this part of styling belongs to an “Element” definition. <div class="card">
<div class="card__heading heading">...</div>
<div class="card__body">...</div>
<div class="card__footer">...</div>
</div> |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If
headingstyles does not rely oncard_heading(ex. for positioning or padding insidecard) it is perfectly fine to removecard__headingwrapper element.