-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Font & assets load issue when append styles in shadow DOM #213
Comments
I have tried these methods to inject css, same issue occur. styles are append and working. CSS variables are not append in dom and fonts are not even downloaded in browser. |
Instead of :host() has no effect outside of shadow DOM, and :root() has no effect inside, so you could build your CSS files to be reusable in light and shadow DOM components by duplicating the variable declarations within the :root and :host blocks. |
@bmomberger-bitovi Thanks for quick reply. _colors-dark.scss _colors-light.scss when i change "root" as "host" it's working fine. how can i get this theme setup? |
Load both the changed colors-dark and the colors-light stylesheets into the shadow DOM using any of the three methods that you outlined above. However, to successfully change the theme, you will need to set a root element inside the Shadow DOM to have |
In above code, we are injecting css styles by <style>{styles}</style> tag.
But the fonts, assets and color variables [:root { --white: #ffffff; }] are not applicable when we build and use this custom element in another app.
Note: Style.json contains raw css.
":root{--primary-color:#2ea7e0;--primary-border:#2ea7e073;}
.logo-container .app-logo{color:var(--primary-color)}.logo-container.empty-container .app-logo{height:50px;opacity:.2}"
The text was updated successfully, but these errors were encountered: