@Target(value=TYPE) @Retention(value=RUNTIME) @Inherited @Documented public @interface Theme
The value
property defines the name of the application theme. When
the theme is present inside the project, it maps to the frontend/theme/<application-theme-name>
/ folder or alternatively to a folder
inside the static resources of a jar file, like src/main/resources/META-INF/resources/theme/<application-theme-name>/
. The
application theme is always based on Lumo theme and this is the recommended
way to theme applications starting from Flow 6.0 and Vaadin 19.
Alternatively , if instead of Lumo theme the Material theme or another "old
style custom theme" is to be used, that can be specified with the themeClass
property. This allows defining a way to translate base component
url to the themed component url (@see AbstractTheme
), which specifies
components styles.
By default com.vaadin.flow.theme.lumo.Lumo
theme is used if it's in
the classpath. You may disable theming with NoTheme
annotation.
Theme
annotation should be added to the AppShellConfigurator
implementation.
Only a single theme can be defined and having multiple instances will throw an exception.
Here is some examples:
@Theme("my-theme")
public class MyAppShell implements AppShellConfigurator {
}
@Theme(themeClass = Lumo.class)
public class MyAppShell implements AppShellConfigurator {
}
AbstractTheme
,
NoTheme
Modifier and Type | Optional Element and Description |
---|---|
Class<? extends AbstractTheme> |
themeClass
The theme translation handler.
|
String |
value
The name of the theme to use.
|
String |
variant
The theme variant, if any.
|
public abstract Class<? extends AbstractTheme> themeClass
public abstract String variant
public abstract String value
Copyright © 2021. All rights reserved.