All files / lib theme.service.ts

87.5% Statements 28/32
100% Branches 3/3
66.66% Functions 2/3
87.5% Lines 28/32

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 331x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1180x 1180x 1180x 1180x 1180x 1180x         1180x 1180x 21568x 21568x 1180x 1180x 1x  
/*******************************************************************************
 * Copyright bei
 * Entwicklungs- und Pflegeverbund für das gemeinsame Fachverfahren gefa
 *
 *******************************************************************************/
import { Injectable } from '@angular/core';
 
/**
 * Available themes color themes
 */
export type GefaColorTheme = 'default' | 'green' | 'purple';
 
/**
 * Service to switch the theme
 */
@Injectable({ providedIn: 'root' })
export class GefaThemeService {
  /**
   * Set the new color theme
   */
  set colorTheme(value: GefaColorTheme) {
    document.body.classList.remove(`gc-theme-${this._colorTheme}`);
    this._colorTheme = value;
    document.body.classList.add(`gc-theme-${this._colorTheme}`);
  }
 
  get colorTheme(): GefaColorTheme {
    return this._colorTheme;
  }
 
  private _colorTheme: GefaColorTheme = 'default';
}