Inject styles inside shadow dom. #6687
-
Hello, Since the application is rendered inside a shadow root, ui5-webcomponents-react styles are not applied. If I disable shadow root, all styles are applied. In the previous version that used jss, I was able to partially bypass this issue by configuring jss insertionPoint inside the shadow root. Now that jss is gone, I am curious if there is any other way to specify a CSS injection point? Here is a sample application that reproduces the issue. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @tgreblicki, this was a tricky one! 😄 Our stylesheets are added to the 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 can also open a PR in your repo - just let me know! 🙂 |
Beta Was this translation helpful? Give feedback.
Hi @tgreblicki,
this was a tricky one! 😄
Our stylesheets are added to the
adoptedStyleSheets
of thedocument
, which means they aren't available inside ashadowRoot
. To include them in the shadow root, they need to be synchronized with theadoptedStyleSheets
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 …