← Back to release summary

CSSPseudoElement interface

Category
CSS
Type
New or changed feature
Status
Proposed (Chrome Proposed)
Intent stage
None

Summary

CSSPseudoElement interface is a way to represent a pseudo-element in JS. CSSPseudoElement is returned from Element.pseudo(type), where `type` is currently: ::after, ::before, ::marker. CSSPseudoElement is a proxy object that represents a pseudo-element, so, unlike a pseudo-element, CSSPseudoElement always exists. CSSPseudoElement has the following attributes/methods: - The type attribute is a string representing the type of the pseudo-element. - The element attribute is the ultimate originating element of the pseudo-element. - The parent attribute is the originating element of the pseudo-element (Either Element of CSSPseudoElement for nested pseudo-elements). - The pseudo(type) method to retrieve nested pseudo-elements.

Standards & signals

View on chromestatus.com