You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Nashorn
changed the title
Styling by :host.some-class -- styling is ignored
Styling by ":host.someclass" -- styling is ignored in shadow dom components
Sep 25, 2020
When using
:host
selector for styling components, you might try a rule like this:When your component has the
.hidden
class, the css rule above works:When your component is in the shadow and has the
.hidden
class, the css rule above is ignored:SOLUTION:
This is by w3c specification. Your css rule is invalid for shadow dom. The correct syntax is:
The problem is, when not running in shadow,
:host(.hidden)
is ignored, you'll have toalter the rule again for non shadow dom.
[TODO: Fix issue in
onTransformStyle()
]NOTE:
The rule,
:host(.hidden)
is not the same as:host .hidden
.The text was updated successfully, but these errors were encountered: