Package io.jmix.flowui.kit.theme
Class ThemeUtils
java.lang.Object
io.jmix.flowui.kit.theme.ThemeUtils
Utility class related to theme handling.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
The web storage key for which the theme value will be set -
Method Summary
Modifier and TypeMethodDescriptionstatic void
Applies the 'Dark' theme variant for the currentUI
.static void
applyDarkTheme
(com.vaadin.flow.component.UI ui) Applies the 'Dark' theme variant for the givenUI
.static void
Applies the 'Light' theme variant for the currentUI
.static void
applyLightTheme
(com.vaadin.flow.component.UI ui) Applies the 'Light' theme variant for the givenUI
.static void
Applies the 'System' theme variant for the currentUI
which means that the theme variant will switch between light and dark themes depending on OS setting (via the browsers 'prefers-color-scheme').static void
applySystemTheme
(com.vaadin.flow.component.UI ui) Applies the 'System' theme variant for the givenUI
which means that the theme variant will switch between light and dark themes depending on OS setting (via the browsers 'prefers-color-scheme').static void
applyTheme
(com.vaadin.flow.component.UI ui, String theme) Applies the given theme variant for the givenUI
.static void
applyTheme
(String theme) Applies the given theme variant for the currentUI
.
-
Field Details
-
THEME_STORAGE_KEY
The web storage key for which the theme value will be set- See Also:
-
-
Method Details
-
applySystemTheme
public static void applySystemTheme()Applies the 'System' theme variant for the currentUI
which means that the theme variant will switch between light and dark themes depending on OS setting (via the browsers 'prefers-color-scheme'). -
applySystemTheme
public static void applySystemTheme(com.vaadin.flow.component.UI ui) Applies the 'System' theme variant for the givenUI
which 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
-
applyLightTheme
public static void applyLightTheme()Applies the 'Light' theme variant for the currentUI
. -
applyLightTheme
public 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
-
applyDarkTheme
public static void applyDarkTheme()Applies the 'Dark' theme variant for the currentUI
. -
applyDarkTheme
public 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
-
applyTheme
Applies the given theme variant for the currentUI
.- Parameters:
theme
- the theme variant to apply, ornull
to remove the theme variant value from web storage
-
applyTheme
Applies the given theme variant for the givenUI
.- Parameters:
ui
- the UI for which apply the given theme varianttheme
- the theme variant to apply, ornull
to remove the theme variant value from web storage
-