Hi,
I am making a structure for list that can be reused in other block elements but I have doubts with the nested items. If you make the sublist elements as a block itself, what would happen with its li elements, do you need to name them according with its father block element or they can be generic?
<ul class="list list--default">
<li class="list--default__item">Lorem ipsum dolor sit amet</li>
<li class="list--default__item">
Lorem ipsum dolor <a href="#" title="link title" target="_self">sit amet</a>
<ul class="list--default-sublist">
<li class="list--default__item">
Lorem ipsum dolor sit amet
<ul class="list--default-sublist">
<li class="list--default__item">Lorem ipsum dolor sit amet</li>
<li class="list--default__item">Lorem ipsum dolor sit amet</li>
</ul>
</li>
<li class="list--default__item">Lorem ipsum dolor sit amet</li>
</ul>
</li>
</ul>
Thx a lot.
There are two possible variants.
If nested list homehow differs from its parent, it may be a block itself:
otherwise just you the same block for nested as well.
But please pay attention that you don't need to have
--default
in the names of elements.Hi @tadatuta,
Ok, I can see. So what about this:
Thanks again.
I'd do it like this:
Ok, but can a modifier be alone without a block?, I refer about "list--lvl2", "list--lvl3", etc.
What is the rule to use BLOCK or MODIFER inside a father?
you can't use modifier without block classname but you don't need to keep parent's modifier name for its children.