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

Rather than using `::part()` explicitly, since it's intended as an authoring mechanism, we should probably instead define `::details-content` as a pseudo-element on `details`, pointing to the anonymous box wrapped around the contents (or, in shadow dom terms, the `div` in the `<shadow><div><slot selector=":not(summary:first-child)"></slot></div></shadow>` of the UA shadow tree).

This would solve a number of problems all at once:

* this thread's issue, allowing authors to put `::before`/`::after` before/after the contents, so they're not displayed when the `details` is closed
* allow authors to style the `details` as open via CSS, for print styles or the like (see <https://github.com/w3c/csswg-drafts/issues/2084> for this request)
* allow authors to lay out the contents of `details` with a non-block `display` value, without requiring an extra wrapper element

If this sounds like something worthwhile, I'm happy to help write up spec text. I expect it would be defined in HTML.

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

Received on Friday, 21 September 2018 22:09:40 UTC