Does anybody know how to use :host
(or :host()
) with :has()
?
For example something like this:
:host:has([disabled]) {
opacity: 0.75;
}
or
:host(:has([disabled])) {
opacity: 0.75;
}
With the syntax from my example the opacity
is not applied.
disabled
is an attribute on your Custom Element. It is:host([disabled])
– Pochard<custom-element disabled />
, not an "host" having children with the attribute "disabled". Hence the need of the:has()
function – Inexorable