File

projects/tl-elements/src/lib/tl-themes/tl-themes.component.ts

Extends

TamuAbstractBaseComponent

Implements

OnInit

Metadata

Index

Properties
Methods
Inputs
HostBindings
Accessors

Inputs

activeTheme
Type : string
inheritFontStyle
Type : "true" | "false"

HostBindings

style.--tl-font-family-sans-serif
Type : string
Default value : 'var(--tl-default-font-family-sans-serif)'

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)'

Allows for the override of the --tl-default-font-size css variable.

Methods

ngOnInit
ngOnInit()
Returns : void

Properties

Private _themeName
_fontFamily
Type : string
Default value : 'var(--tl-default-font-family-sans-serif)'
Decorators :
@HostBinding('style.--tl-font-family-sans-serif')

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')

Allows for the override of the --tl-default-font-size css variable.

Accessors

activeTheme
setactiveTheme(name: string)
Parameters :
Name Type Optional
name string No
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

Legend
Html element
Component
Html element with directive

results matching ""

    No results matching ""