Skip to content

Commit 4bf10ae

Browse files
javier-godoypaodb
authored andcommitted
docs(readme): document DynamicTheme
1 parent 156e423 commit 4bf10ae

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,28 @@ By default, help content will be rendered in a `Dialog`.
4343

4444
![image](https://github.com/FlowingCode/CommonsDemo/assets/11554739/055a447e-a104-4ec7-a98c-fc1df8abef01)
4545

46+
## Dynamic Theme
47+
48+
Available in Vaadin 25+, this feature allows you to verify add-on behavior across the Lumo and Aura themes, as well as with minimal base styles. The theme can be switched at runtime using the theme selector in the footer of the `TabbedDemo` component.
49+
50+
<img width="91" height="106" alt="image" src="https://github.com/user-attachments/assets/cce58a29-f779-477d-89b4-ee845a80b962" />
51+
52+
To enable this feature, the `DynamicTheme` must be initialized in the `AppShellConfigurator` of the application. Ensure that the legacy `@Theme` annotation and any Aura or Lumo `@StyleSheet` references are removed.
53+
54+
```java
55+
public class AppShellConfiguratorImpl implements AppShellConfigurator {
56+
57+
@Override
58+
public void configurePage(AppShellSettings settings) {
59+
if (DynamicTheme.isFeatureSupported()) {
60+
DynamicTheme.LUMO.initialize(settings);
61+
}
62+
}
63+
64+
}
65+
```
66+
67+
4668
## Code Viewer
4769

4870
The code viewer component (`SourceCodeViewer`) is responsible of rendering a Java source file along the demo.

0 commit comments

Comments
 (0)