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
We have some places where we apply styles based on whether a slot contains content. Our current pattern for doing this involves using the FAST slotted directive to run JS code that tracks content being added and removed, then set classes on the component based on that state.
The native :has-slotted CSS pseudoclass is meant to provide the same capability using pure CSS. It's not currently available in Safari but once it is we should investigate whether we can use it instead to simplify our code and reduce execution overhead.
Lots more context on this CSSWG issue, including a tangent about why :has isn't appropriate since it doesn't operate across the shadow root boundary: w3c/csswg-drafts#6867
The text was updated successfully, but these errors were encountered:
🧹 Tech Debt
We have some places where we apply styles based on whether a slot contains content. Our current pattern for doing this involves using the FAST
slotted
directive to run JS code that tracks content being added and removed, then set classes on the component based on that state.The native :has-slotted CSS pseudoclass is meant to provide the same capability using pure CSS. It's not currently available in Safari but once it is we should investigate whether we can use it instead to simplify our code and reduce execution overhead.
A non-exhaustive list of places that do this:
footer-actions
slotfooter
slotLots more context on this CSSWG issue, including a tangent about why
:has
isn't appropriate since it doesn't operate across the shadow root boundary: w3c/csswg-drafts#6867The text was updated successfully, but these errors were encountered: