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
The ::slotted() pseudo-element represents the elements assigned, after flattening, to a slot. This pseudo-element only exists on slots.
If I now arrive at a situation where the fallback for a slot is used, I am guessing that it'll come up in the flattened view as well. That would mean that I can find use the ::slotted() to query the fallback markup elements and apply styles to them?
It's not really clear how to style the fallback content in general.
Currently I am doing something like this inside my shadow-root styles.
/* works but not sure if this is the best way to do it. */slot[name="profile-picture"] svg {
width:64px;
height:64px;
}
/* doesn't */
::slotted(svg) {
width:var(--card-picture-dimension,64px);
height:var(--card-picture-dimension,64px);
}
The text was updated successfully, but these errors were encountered:
The spec says
If I now arrive at a situation where the fallback for a slot is used, I am guessing that it'll come up in the flattened view as well. That would mean that I can find use the
::slotted()
to query the fallback markup elements and apply styles to them?It's not really clear how to style the fallback content in general.
Currently I am doing something like this inside my shadow-root styles.
The text was updated successfully, but these errors were encountered: