Re: [csswg-drafts] Flattened element tree and pseudo-elements

I personally don't see a logical need for slotting `::before`/`::after` in the template. The pseudos always go before/after _all_ the element's children in the flattened tree, whether those children are from the light DOM or the shadow. It's not super convenient, but it's predictable.

However, I'm sure there are cases where it could be useful to reposition CSS generated content.  For example, if you have a `<chapter-header>` component which has a chapter number assigned with CSS counters, and you want to control exactly where that gets laid out.

If they _were_ to be slottable in the template, how would that work?  A `::before` on the host is implicitly slotted before all shadow DOM content _unless_ an explicit `<slot name="::before"/>` is included elsewhere in the tree? What other pseudo-elements would be slottable? Could you slot a `::marker`? But then what about pseudo-elements that are just shortcuts to style boxes in the shadow tree (as in the proposed `::part()` selector, or the many existing selectors for form element or scrollbar components)?

More comments on the specifics of details/summary vs fieldset/legend on the other issue: https://github.com/whatwg/html/issues/3805#issuecomment-422488912

-- 
GitHub Notification of comment by AmeliaBR
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/3126#issuecomment-422492153 using your GitHub account

Received on Tuesday, 18 September 2018 18:06:50 UTC