-
Notifications
You must be signed in to change notification settings - Fork 176
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
Content of WebComponentExporter was moved to shadow-root in new vaadin version (CSS Styles not applied anymore) #9880
Comments
This does indeed look fishy, but I cannot right now say whether this change is intended or some kind of defect. I reproduced the issue by changing the Vaadin version in The |
Hello, thanks for the report.
I can't say why So :
We have this ticket for styling web components : #8564 |
Hi and thanks for your both replies. I understand if it's a design decision then i need to find a way to apply my styles to the exported web component, so it makes sense to declare my issue a duplicate of #8564 If i understand correctly, it seems - according to rolfsmeds - there will be coming a theming solution in V19. But the workaround also works for now, I will keep an eye open. thanks ! |
To summarize, this is indeed an intentional change that we failed to clearly mark as such in release notes. I'm terribly sorry about the confusion and extra investigation work it has caused for you. It's good to hear that you have found a workaround that you can use until the improvements planned for Vaadin 19 will become available. I'm closing this as a duplicate-ish of #8564. |
Not sure if it is a bug or intended behavior.
Nevertheless it causes me a problem that I currently cannot solve so maybe there is a workaround that will work.
Description of the bug
I work on a spring boot project that initially used JSP as frontend. Vaadin is included using WebComponentExporter. It worked fine so far but after upgrading from vaadin 14.1.16 to 14.4.6 the vaadin content of the view - referenced by the custom JSP tag, created by the exporter - doesn't appear as a child of the said JSP tag anymore but is placed within the #shadow-root.
This has an influence on my css files that i include using the
@Stylesheet
Annotation on top of the vaadin view. Since all objects are now within the shadow-root the css doesn't apply to them anymore and everything is style-less. I also tried@CssImport
using my custom JSP tag asthemeFor
but it didn't work either.Minimal reproducible example
I created a running example project:
https://github.com/tagtraeumer/vaadin-issue-wcestyle
It contains all necessary files for this issue and uses the new vaadin version and the attempted solution using
@CssImport
The url is http://localhost:8080/v/main
Expected behavior
Either the content is not outside of the #shadow-root and can access the
@Stylesheet
referenced css file and its styles, same as it happened in the older version, or the@CssImport
works for the specified custom JSP tag.I assume there is an easy solution for the second one and I couldn't get it running as intended.
Actual behavior
The styles are not applied either way.
Versions
The text was updated successfully, but these errors were encountered: