Skip to content

No auto-injection of global styles to the embedded components #22716

@mshabarov

Description

@mshabarov

Describe your motivation

Vaadin 25 supports autoInjectGlobalCssImports flag in theme.json that controls the injection of host app styles into embedded components. However, this is deprecated along with the Theme annotation and we need an alternative to control the injection.

Describe the solution you'd like

Instead of adding one more parameter/flag, we can let users to control this by placing CssImport annotation on the right place:

  • Common styles in the app and embedded components - add CssImports to the AppShellConfigurator implementing class and all embedded components (WebComponentExporter).
  • Application specific styles that only wanted in the application. Add CssImports to the AppShellConfigurator implementing class only and they don't leak into embedded components.
  • Embedded specific styles isolated in embedded component. Add CssImports to WebComponentExporter only and these styles would not leak into host app (already implemented in Styling embedded web components using CssImport annotation #22637)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    Status

    🪵Product backlog

    Status

    Next for Dev. Team

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions