You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Does this extend to vendor-prefixed pseudo-elements as well? The current behavior in Chrome and the latest Safari Tech Preview (96 as of writing) is that prefixed pseudo elements do not work with shadow parts.
Undefined, basically by definition - they're vendor-prefixed because they're not standardized, so the CSSWG doesn't define how they act. This should be raised against the browser vendor to decide.
I can see arguments either way, fwiw:
On the pro side, this seems self-evidently useful.
On the con side, this exposes internal details of how the part is implemented. This is precisely why sub-parts have to be explicitly forwarded by the component for them to be visible in the outer page. (::before/etc are present on all elements, so it doesn't expose anything, beyond just whether or not the component is also using the pseudo.)
Back on the pro side, components can forward sub-parts into their own exposed parts, surfacing useful bits when needed. But there's no syntax for forwarding built-in pseudos, so forbidding it by default would also forbid it at all times.
Overall, I suspect the morally correct answer is to lean towards not exposing them, but I suspect the practically correct answer is to expose them.
As per the spec, the
::part()
pseudo-element can take additional pseudo-elements after it such as::before
(source: https://drafts.csswg.org/css-shadow-parts/#part).Does this extend to vendor-prefixed pseudo-elements as well? The current behavior in Chrome and the latest Safari Tech Preview (96 as of writing) is that prefixed pseudo elements do not work with shadow parts.
Example: https://codepen.io/liamdebeasi/pen/jOOpQKa
I'm wondering if this is just a browser bug, or maybe a part of the spec that just needs clarification. Thanks!
The text was updated successfully, but these errors were encountered: