Dynamic Theme¶
Available in Vaadin 25+, the Dynamic Theme feature lets you verify add-on behavior across the Lumo and Aura themes, as well as with minimal base styles. The theme is switched at runtime through the theme selector in the footer of the TabbedDemo component.
Enabling Dynamic Theme¶
Vaadin 25+¶
Initialize DynamicTheme in your application's AppShellConfigurator. Make sure the legacy @Theme annotation and any Aura or Lumo @StyleSheet references are removed first:
public class AppShellConfiguratorImpl implements AppShellConfigurator {
@Override
public void configurePage(AppShellSettings settings) {
if (DynamicTheme.isFeatureSupported()) {
DynamicTheme.LUMO.initialize(settings);
}
}
}
Vaadin 14–25 / 23–25¶
When targeting Vaadin 14–25 or 23–25, the AppShellConfigurator approach is not viable because of framework and library constraints. Instead, create the following configuration file:
src/test/resources/META-INF/dynamic-theme.properties
With the contents:
theme=LUMO