Skip to content

Inject styles inside shadow dom. #6687

Answered by Lukas742
tgreblicki asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @tgreblicki,

this was a tricky one! 😄

Our stylesheets are added to the adoptedStyleSheets of the document, which means they aren't available inside a shadowRoot. To include them in the shadow root, they need to be synchronized with the adoptedStyleSheets of the shadowRoot. You can achieve this by registering with our StyleStore.

To make it easier to understand, I’ve forked your example repo and applied the necessary changes there. Please note that we currently have a bug in the store (only in v2; this issue has been fixed in v1), which might impact the sync logic. A fix will be available next week at the latest.

Fork: https://github.com/Lukas742/embeddable-ui5-example

If you prefer, I …

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@tgreblicki
Comment options

Answer selected by tgreblicki
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants