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
Bundle is not rebuilt if you change files in the theme/components folder #16407
Comments
This also manifests itself in another way:
|
I'd consider this as an enhancement. When we introduced pre-compiled dev bundle feature, we relied on a new |
The problem described here #16407 (comment) looks as a bug to me. I suggest to make a new ticket to track it, because it has nothing to do with |
I'm in the same case, I have no @CssImport, but I'm using the components folder for fine tuning the scrollbars of a grid. |
@Freeman656 note that, as @mshabarov mentioned, the workaround is to disable the bundle (no need to resort to
|
This issue can be seen in production mode as well, Vaadin ignores the styles in
having no styles in the production bundle. While for development mode the workaround is to set
|
I'd like to prioritise this as a high priority bug, which we have to fix in upcoming Vaadin 24.2 and hopefully pick then into 24.1. |
In the documentation, we state that I wonder if we should always require a build of the bundle if there's at least on CSS file in the |
For the issue in #16407 (comment) I can confirm that when we check if a bundle is needed, we do not consider if the bundle stats contain an entry that is not required anymore. |
Yes, whenever any of the files in |
I propose to address this separately (as an another patch), this isn't so severe, like a previous one, but nevertheless would be nice to have. |
The legacy shadow DOM stylesheets that can potentially be present in the 'theme/<themeName>/components/' folder are not considered when deciding if a new bundle needs to be created, so the application may miss custom components styles. This change checks for existence of theme components CSS, and it triggers a bundle rebuild if any is found. Fixes #16407
* fix: handle shadow DOM stylesheets in production and dev bundle The legacy shadow DOM stylesheets that can potentially be present in the 'theme/<themeName>/components/' folder are not considered when deciding if a new bundle needs to be created, so the application may miss custom components styles. This change checks for existence of theme components CSS, and it triggers a bundle rebuild if any is found. Fixes #16407 * apply review suggestions * apply review suggestions
* fix: handle shadow DOM stylesheets in production and dev bundle The legacy shadow DOM stylesheets that can potentially be present in the 'theme/<themeName>/components/' folder are not considered when deciding if a new bundle needs to be created, so the application may miss custom components styles. This change checks for existence of theme components CSS, and it triggers a bundle rebuild if any is found. Fixes #16407 * apply review suggestions * apply review suggestions
* fix: handle shadow DOM stylesheets in production and dev bundle The legacy shadow DOM stylesheets that can potentially be present in the 'theme/<themeName>/components/' folder are not considered when deciding if a new bundle needs to be created, so the application may miss custom components styles. This change checks for existence of theme components CSS, and it triggers a bundle rebuild if any is found. Fixes #16407 * apply review suggestions * apply review suggestions
…) (CP: 24.1) (#17798) * fix: handle shadow DOM stylesheets in production and dev bundle (#17776) * fix: handle shadow DOM stylesheets in production and dev bundle The legacy shadow DOM stylesheets that can potentially be present in the 'theme/<themeName>/components/' folder are not considered when deciding if a new bundle needs to be created, so the application may miss custom components styles. This change checks for existence of theme components CSS, and it triggers a bundle rebuild if any is found. Fixes #16407 * apply review suggestions * apply review suggestions * fixed parent pom version --------- Co-authored-by: Marco Collovati <marco@vaadin.com>
…) (CP: 24.2) (#17797) * fix: handle shadow DOM stylesheets in production and dev bundle (#17776) * fix: handle shadow DOM stylesheets in production and dev bundle The legacy shadow DOM stylesheets that can potentially be present in the 'theme/<themeName>/components/' folder are not considered when deciding if a new bundle needs to be created, so the application may miss custom components styles. This change checks for existence of theme components CSS, and it triggers a bundle rebuild if any is found. Fixes #16407 * apply review suggestions * apply review suggestions * fixed parent pom version --------- Co-authored-by: Marco Collovati <marco@vaadin.com>
This ticket/PR has been released with Vaadin 24.2.0.rc1 and is also targeting the upcoming stable 24.2.0 version. |
This ticket/PR has been released with Vaadin 24.3.0.alpha1 and is also targeting the upcoming stable 24.3.0 version. |
Description of the bug
When your application has a theme folder, you can create files inside the
components
subfolder to override component styles.These are not picked up unless there is a
@CssImport
in the application, or something else that triggers the frontend build.I assume that this is an issue with using precompiled resources unless any frontend resources are modified, but it fails to notice that it's needed when overriding component styles.
Expected behavior
Adding files to the theme components folder should work regardless of using CSS imports or not.
Minimal reproducible example
./themes/myapp/components
, create a filevaadin-text-field.css
with the following contents../mvnw
Application.java
class, add the following@CssImport
:@CssImport("./themes/myapp/styles.css")
node_modules
etc., and once completed, the background of the text field is blue.Versions
The text was updated successfully, but these errors were encountered: