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
I have a use case in which I need to pass a style element to the web component like this:
But it doesn't work. If shadow option is set to open or closed it doesn't matter.
I need to encapsulate styles during runtime that will be loaded over a request.
If this doesn't work what could be the alternative?
constchat=document.createElement("my-chat");chat.Id="5896045a";conststyle=document.createElement('style');style.textContent=` #my-chat { font-family: "Roboto" !important; // some more styles... }`;// Append the style element to the shadow root.chat.shadowRoot.appendChild(style);`
document.body.appendChild(chat);
The text was updated successfully, but these errors were encountered:
I have a use case in which I need to pass a style element to the web component like this:
But it doesn't work. If shadow option is set to open or closed it doesn't matter.
I need to encapsulate styles during runtime that will be loaded over a request.
If this doesn't work what could be the alternative?
The text was updated successfully, but these errors were encountered: