Search code examples
vaadinvaadin14vaadin-chartsvaadin-themes

Vaadin 14 themes - use "include"


recently I've switched our CSS styles for our application and components to theme (added in vaadin 14.6). Right now I'm looking for an alternative to include parameter of @CssImport annotation.

@CssImport(value = "./styles/custom-charts.css", themeFor = "vaadin-chart", include = "vaadin-chart-default-theme")

We have some style changes for vaadin-chart but we needed to include original vaadin-chart-default-theme.

Is there a way to achieve the same with the Theme support?

Thank you


Solution

  • As far as I know, this isn't possible at the moment, for the default Charts theme.

    If you need to reuse some style sheet across components, you should be able to use the standard @import declaration.

    For the Charts default theme, you probably have to use the existing @CssImport or the JavaScript registerStyles() method (from @vaadin/themeable-mixin).