class WebTheme
A class that represents a complete visual theme configuration.
class WebTheme;
Notes
- Create a new theme using
new WebTheme()which initializes with all defaults. - Use fluent methods to customize named colors, icons, and styles.
- Apply a theme using setWebTheme().
Examples
// Create a theme with custom colors
const myTheme = new WebTheme()
.colors({ accent: "#FF5722" })
.darkColors({ accent: "#FF7043" });
// Apply the theme
setWebTheme(myTheme);
Constructor
new WebTheme()
Creates a new theme initialized with all default values.
Type members
type WebTheme.StyleDefinition static
A type that represents a style definition for themed CSS classes.
Instance members
colors()
Sets color overrides, merged with existing colors.darkColors()
Sets dark mode color overrides.icons()
Sets icon overrides, merged with existing icons.darkIcons()
Sets dark mode icon overrides.buttonStyle()
Defines or overrides a button variant style.textFieldStyle()
Defines or overrides a text field variant style.controlTextStyle()
Sets the control text style (font family, size, line height).fontSize()
Sets the font size for all controls.focusDecoration()
Sets the focus decoration style (outline appearance).pageBackground()
Sets the page background color.modalShadeBackground()
Sets the modal shade (backdrop) background color.logicalPxScale()
Sets the logical pixel scale factor.defaultIconStyle()
Sets the default icon size and margin.defaultMenuOffset()
Sets the default modal menu offset from the reference element.updateBodyStyle()
Sets whether to update the body element style initially.importCSS()
Adds a CSS import by URL.cloneTheme()
Creates a copy of this theme’s current state.
