-
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
How can I inject my scss style into the Web Components? #147
Comments
For now , I have define a Web Component successly, but the style has lost. |
|
Hi @telephant , |
@telephant @bmomberger-bitovi |
There are four ways to define style in web components with shadow DOM:
Because React components render in light DOM, CSS and other styling solutions built around React do not expect to have to use a different root for styles, and generally put styles in the . This will not work when using shadow DOM. You either have to configure your solution to use somewhere within the Shadow DOM as an anchor point for local styles, or do it yourself by placing a <style> tag with your local styles or a tag pointing to a remote stylesheet somewhere in the shadow DOM. Shadow DOM support has only been added to r2wc recently, so we don't yet have consensus about the best practices for styling shadow components with r2wc. But we are discussing it and starting to work on solutions! |
hello. do you have an example of any of this solutions |
just import scss file in component, like:
I will use the rollup postcss to compile all the scss |
Thanks for answering. But I am still confusing about the I packed the project as a UI component, so there is no |
No description provided.
The text was updated successfully, but these errors were encountered: