projects/tl-elements/src/lib/tl-themes/tl-themes.component.ts
selector | tl-themes-component |
styleUrls | ./tl-themes.component.scss |
templateUrl | ./tl-themes.component.html |
Properties |
|
Methods |
Inputs |
HostBindings |
Accessors |
activeTheme | |
Type : string
|
|
inheritFontStyle | |
Type : "true" | "false"
|
|
Inherited from
TamuAbstractBaseComponent
|
|
Defined in
TamuAbstractBaseComponent:14
|
style.--tl-font-family-sans-serif |
Type : string
|
Default value : 'var(--tl-default-font-family-sans-serif)'
|
Inherited from
TamuAbstractBaseComponent
|
Defined in
TamuAbstractBaseComponent:12
|
Allows for the override of the --tl-font-family-sans-serif css variable. |
style.--tl-font-size |
Type : string
|
Default value : 'var(--tl-default-font-size)'
|
Inherited from
TamuAbstractBaseComponent
|
Defined in
TamuAbstractBaseComponent:9
|
Allows for the override of the --tl-default-font-size css variable. |
ngOnInit |
ngOnInit()
|
Returns :
void
|
Private _themeName |
_fontFamily |
Type : string
|
Default value : 'var(--tl-default-font-family-sans-serif)'
|
Decorators :
@HostBinding('style.--tl-font-family-sans-serif')
|
Inherited from
TamuAbstractBaseComponent
|
Defined in
TamuAbstractBaseComponent:12
|
Allows for the override of the --tl-font-family-sans-serif css variable. |
_fontSize |
Type : string
|
Default value : 'var(--tl-default-font-size)'
|
Decorators :
@HostBinding('style.--tl-font-size')
|
Inherited from
TamuAbstractBaseComponent
|
Defined in
TamuAbstractBaseComponent:9
|
Allows for the override of the --tl-default-font-size css variable. |
activeTheme | ||||||
setactiveTheme(name: string)
|
||||||
Parameters :
Returns :
void
|
import { Component, Input, OnInit } from '@angular/core';
import { actions } from '@wvr/elements';
import { TamuAbstractBaseComponent } from '../shared/tl-abstract-base.component';
import { themes } from '../shared/themes';
@Component({
selector: 'tl-themes-component',
templateUrl: './tl-themes.component.html',
styleUrls: ['./tl-themes.component.scss']
})
export class TlThemesComponent extends TamuAbstractBaseComponent implements OnInit {
private _themeName;
@Input() set activeTheme(name: string) {
if (Object.keys(themes)
.includes(name)) {
this.store.dispatch(actions.Theme.select({
name
}));
this._themeName = name;
} else {
console.warn(`'${name}' is not a known theme!`);
}
}
ngOnInit(): void {
super.ngOnInit();
if (!this._themeName) {
this.activeTheme = 'tamu';
}
}
}
./tl-themes.component.scss