theming / Class

ThemeManager

Decorators:@Injectable

Facade-level service that is responsible for high-level theme operations.

Notes

This service is provided in root by default.

Properties

NameTypeDescription
injector
p
Injector
tokens
p
ThemeTokenRegistry

Methods

apply()

Apply the given theme tokens to the application to make them take effect.

Notes

Previously applied tokens will not be cleared when applying new tokens. New tokens will overwrite the previous ones when the token names conflict.

Presentation
apply(tokens: ThemeTokens): void;
Parameters
NameTypeDescription
tokens
ThemeTokens
Returns
void

build()

Resolves a list of token generation specifications into a single object of merged theme tokens.

Notes

Specifications are resolved in order, and tokens generated from later specifications will overwrite the previous ones when the token names conflict.

Presentation
build(compositions: ThemeBuilderComposition[]): ThemeTokens;
Parameters
NameTypeDescription
compositions
ThemeBuilderComposition[]

theme token generation specifications

Returns
ThemeTokens -

generated theme tokens from all the specifications, merged into a single object.