ThemeBuilder
Generic types: | Config |
Responsible for generating a group of theme tokens based on a configuration.
Notes
The generic type parameter declares the acceptable configuration type.
This package contains a built-in implementation:
.
Methods
build() | ||||||
---|---|---|---|---|---|---|
Generate a group of theme tokens based on a configuration. | ||||||
Presentation
| ||||||
Parameters
Returns |
Example usage
export interface MyThemeConfig {
primaryColor: string;
}
export class MyThemeBuilder implements ThemeBuilder <MyThemeConfig> {
build(context: ThemeBuilderContext <MyThemeConfig>): ThemeTokens {
return {
[`${context.name}-primary-color`]: context.config .primaryColor,
};
}
}