:defined
Since UXP v6.0
Represents any element that has been defined.
See: :defined
Syntax:
:defined {
/* ... */
}
Example: <br></br> Demonstrates the application of styles via :defined
data-slots=heading, code
data-repeat=2
data-languages=HTML, CSS
HTML
<simple-custom text="Custom element example text"></simple-custom>
<p>Standard paragraph example text</p>
CSS
/* Give the `p` elements distinctive background */
p {
background: yellow;
}
/* Both the custom and the built-in element are given italic text */
:defined {
font-style: italic;
}
/* Only simple-custom element is applied with green background*/
simple-custom:defined {
display: block;
background: green;
}