← Back to release summary

:has-slotted pseudo selector

Category
CSS
Type
New or changed feature
Status
In developer trial (Behind a flag) (Chrome In developer trial (Behind a flag))
Intent stage
None

Summary

The :has-slotted pseudo class represents a slot element with slotted content, such as a text node or element. This can be used to style elements based on whether or not they are using slot fallback content.

Motivation

The :has-slotted pseudo class represents a slot element with slotted content, such as a text node or element. This can be used to style elements based on whether or not they are using slot fallback content.

Standards & signals

Explainers: https://drafts.csswg.org/css-scoping/#the-has-slotted-pseudo

View on chromestatus.com