:host:defined doesn't work, :host(:defined) works [duplicate]
问题 This question already has answers here : Why do pseudoclasses on the host element have to be inside of the host function? (2 answers) Closed 5 months ago . Is it not possible, or not allowed, to combine :host and :defined in CSS, while combining the latter with the :host() pseudoclass works? As you can see in below example, the following :host:defined { display: block; } does not work, while :host(:defined) { display: block; } works. class CustomElement extends HTMLElement { constructor() {