Package io.jmix.flowui.kit.theme
Class ThemeUtils
java.lang.Object
io.jmix.flowui.kit.theme.ThemeUtils
Utility class related to theme handling.
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final StringThe web storage key for which the theme value will be set
- 
Method SummaryModifier and TypeMethodDescriptionstatic voidApplies the 'Dark' theme variant for the currentUI.static voidapplyDarkTheme(com.vaadin.flow.component.UI ui) Applies the 'Dark' theme variant for the givenUI.static voidApplies the 'Light' theme variant for the currentUI.static voidapplyLightTheme(com.vaadin.flow.component.UI ui) Applies the 'Light' theme variant for the givenUI.static voidApplies the 'System' theme variant for the currentUIwhich means that the theme variant will switch between light and dark themes depending on OS setting (via the browsers 'prefers-color-scheme').static voidapplySystemTheme(com.vaadin.flow.component.UI ui) Applies the 'System' theme variant for the givenUIwhich means that the theme variant will switch between light and dark themes depending on OS setting (via the browsers 'prefers-color-scheme').static voidapplyTheme(com.vaadin.flow.component.UI ui, String theme) Applies the given theme variant for the givenUI.static voidapplyTheme(String theme) Applies the given theme variant for the currentUI.
- 
Field Details- 
THEME_STORAGE_KEYThe web storage key for which the theme value will be set- See Also:
 
 
- 
- 
Method Details- 
applySystemThemepublic static void applySystemTheme()Applies the 'System' theme variant for the currentUIwhich means that the theme variant will switch between light and dark themes depending on OS setting (via the browsers 'prefers-color-scheme').
- 
applySystemThemepublic static void applySystemTheme(com.vaadin.flow.component.UI ui) Applies the 'System' theme variant for the givenUIwhich means that the theme variant will switch between light and dark themes depending on OS setting (via the browsers 'prefers-color-scheme').- Parameters:
- ui- the UI for which apply the 'System' theme variant
 
- 
applyLightThemepublic static void applyLightTheme()Applies the 'Light' theme variant for the currentUI.
- 
applyLightThemepublic static void applyLightTheme(com.vaadin.flow.component.UI ui) Applies the 'Light' theme variant for the givenUI.- Parameters:
- ui- the UI for which apply the 'Light' theme variant
 
- 
applyDarkThemepublic static void applyDarkTheme()Applies the 'Dark' theme variant for the currentUI.
- 
applyDarkThemepublic static void applyDarkTheme(com.vaadin.flow.component.UI ui) Applies the 'Dark' theme variant for the givenUI.- Parameters:
- ui- the UI for which apply the 'Dark' theme variant
 
- 
applyThemeApplies the given theme variant for the currentUI.- Parameters:
- theme- the theme variant to apply, or- nullto remove the theme variant value from web storage
 
- 
applyThemeApplies the given theme variant for the givenUI.- Parameters:
- ui- the UI for which apply the given theme variant
- theme- the theme variant to apply, or- nullto remove the theme variant value from web storage
 
 
-