Annotation 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/themes/<application-theme-name>/ folder or alternatively to a
folder inside the static resources of a jar file, like
src/main/resources/META-INF/resources/themes/<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 {
}
- Since:
- 1.0
- Author:
- Vaadin Ltd
- See Also:
-
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionClass<? extends AbstractTheme> Deprecated.The theme translation handler.Deprecated.The name of the theme to use.Deprecated, for removal: This API element is subject to removal in a future version.UseColorSchemeannotation instead
-
Element Details
-
themeClass
Class<? extends AbstractTheme> themeClassDeprecated.The theme translation handler.- Returns:
- theme handler
- Default:
com.vaadin.flow.theme.AbstractTheme.class
-
variant
Deprecated, for removal: This API element is subject to removal in a future version.UseColorSchemeannotation insteadThe theme variant, if any.Deprecated: Use
ColorSchemeannotation instead to set the color scheme for the application.- Returns:
- the theme variant
- Default:
""
-
value
String valueDeprecated.The name of the theme to use. If this is not specified will default to Lumo.- Returns:
- the theme name
- Default:
""
-
StyleSheetto load one or more stylesheets from public static resources locations orCssImportto load one or more stylesheets from asrc/main/frontend/folder and use mechanisms native to HTML, CSS and React (e.g.@import url("morestyles.css")in CSS).