0

I am creating list-style component where the component itself doesn't know the children of its child elements.

Using the standard <ul> element as an example:

<ul>
  <li><div>Part 1</div><div style="margin-left: 10px">[Part 2]</div></li>
  <li><div>Part 1</div><div style="margin-left: 10px">[Part 2]</div></li>
  <li><div>Part 1</div><div style="margin-left: 10px">[Part 2]</div></li>
</ul>

So I'd expect my list element to layout and style each <li>, as that is part of the API, but not the contents.

How does one achieve this with web components/lit-element?

Cheetah
  • 13,785
  • 31
  • 106
  • 190
  • By learning native Web Components technologies ``slot`` and [``::slotted``](https://stackoverflow.com/questions/61626493/slotted-css-selector-for-nested-children-in-shadowdom-slot/61631668#61631668) CSS first – Danny '365CSI' Engelman Sep 24 '22 at 08:13

0 Answers0