SiThemeService documentation¶
import { SiThemeService } from '@siemens/element-ng/theme'; Attributes and Methods¶
| Name | Type | Default | Description |
|---|---|---|---|
| activeThemeName optional ¶ | string | The name of the theme that is active. Theme name | |
| addOrUpdateTheme() ¶ | (theme: Theme) => Observable<boolean> | Adds or updates the given theme in the theme store. Returns: | |
| applyTheme() ¶ | Applies the given theme to the configured theme target. If no theme is given, the active theme is applied. | ||
| applyThemeType() ¶ | Apply | ||
| deleteTheme() ¶ | (name: string) => Observable<boolean> | Deletes the theme with the given name from the theme store. | |
| getActiveTheme() ¶ | () => Observable<Theme | undefined> | Loads and returns the currently active theme. Returns undefined if no custom theme is used. Returns: A custom theme or | |
| getTheme() ¶ | (name: string) => Observable<Theme | undefined> | Returns a clone of the theme with the given name or Returns: The theme with the given name and | |
| hasTheme() ¶ | Returns | ||
| isThemeValid() ¶ | Checks if the given theme JSON object is a valid theme. | ||
| resetPreview() ¶ | () => void | Resets the preview theme to the default element theme. | |
| (readonly)resolvedColorScheme ¶ | ThemeType | undefined | The current color scheme. (e.g. light or dark). | |
| (readonly)resolvedColorScheme$ ¶ | Observable<keyof ThemeColorSchemes> | this.resolvedColorSchemeSub.asObservable() | Emits events when the color scheme changes. |
| setActiveTheme() ¶ | (name?: string, type?: ThemeType) => Observable<boolean> | Sets the active theme to the given name. If no name is given, the default element theme is used. | |
| (readonly)themeChange ¶ | EventEmitter<Theme | undefined> | new EventEmitter<Theme | undefined>() | Emits events when the currently applied theme changes. Either by changing to another theme or by re-applying a theme with updated properties. When switching to default theme element, |
| (readonly)themeIcons ¶ | WritableSignal<Record<string, string>> | {} | Icon overrides by the currently activeTheme. |
| (readonly)themeNames ¶ | string[] | All available theme names, including element theme name. | |
| (readonly)themeNames$ ¶ | Observable<string[]> | this.themeNamesSub.asObservable() | Emits events when the list of available theme names changes. |
| updateProperty() ¶ | (name: string, value: string, type: keyof ThemeColorSchemes) => void | Updates the given property of the preview theme. |
Types Documentation¶
A map of icons that overrides the default Element icons. The key must be the key of the original icon that should be overridden. The value has to be a data SVG string. Example:import type { Theme } from '@siemens/element-ng/theme';
{
elementUser: "data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'>...</svg>"
}
dark ? : light ? : import type { ThemeColorSchemes } from '@siemens/element-ng/theme';
ThemeColorScheme ¶ ThemeColorScheme ¶
import type { ThemeType } from '@siemens/element-ng/theme';
import type { ThemeColorScheme } from '@siemens/element-ng/theme';
import type { ColorScheme } from '@siemens/element-ng/theme';
Except where otherwise noted, content on this site is licensed under MIT License.