Rich-Harris / stacking-order

Determine which of two elements is in front of the other

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Consider Element.assignedSlot?

robrez opened this issue · comments

Given an element with slots such as the following:

my-element
  #shadowRoot
      <div class="head"><slot name="head"></slot></div>
      <div class="body"><slot></slot></div>

And utilization such as this:

<my-element>
  <div body>Body content is second</div>
  <div head slot="head">Title is first</div>
</my-element>

Perhaps the following should return -1?

compare(querySelector("div[body]"), querySelector("div[head]"))

Consider, also, styling within the element hosting the slots could very well apply z-indexing, etc.