Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardHTMLslotted part exportpartsSingle-choice MCQ

::slotted() can only match the top-level assigned nodes of a slot, not their descendants. Given a flattened tree where <p> is slotted and contains an <em>, which rule (written in the shadow CSS) actually matches, and why?

<!-- light DOM --> <x-q><p>hi <em>there</em></p></x-q> /* shadow CSS candidates */ ::slotted(p) {} /* R1 */ ::slotted(em) {} /* R2 */ ::slotted(p) em {} /* R3 */