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
otherwise the following will fail if styles are prepended:
template = html`
<!-- Element styles are currently prepended here. --><!-- import a lib, f.e. bootstrap. --><linkrel="stylesheet" href="./lib.css" />
<!-- Because lib.css ends up *after* element styles, element styles do not override lib styles. --><divclass="lib-btn"></div>
`
Current workaround is to define styleRoot where styles will be appended:
#styleRoot=document.createElement('div')getstyleRoot(){returnthis.#styleRoot}template=html`<!-- import a lib, f.e. bootstrap. --><linkrel="stylesheet" href="./lib.css" /><!-- Element styles are prepended here in the styleRoot. -->${this.styleRoot}<!-- Styles work as expected, element styles overrode lib styles. --><divclass="lib-btn"></div> `
The text was updated successfully, but these errors were encountered:
trusktr
changed the title
inject styles at the end of the ShadowRoot children
inject element's styles at the end of the ShadowRoot children
Apr 8, 2024
otherwise the following will fail if styles are prepended:
Current workaround is to define
styleRoot
where styles will be appended:PR:
The text was updated successfully, but these errors were encountered: