Files
doneit-web/src/app/services/theme.service.ts
T
2022-04-28 09:32:27 +01:00

32 lines
641 B
TypeScript

import { Injectable } from '@angular/core';
import { StorageService } from 'src/app/services/storage.service';
@Injectable({
providedIn: 'root'
})
export class ThemeService {
themes = [
'gov',
'default',
'tribunal'
]
currentTheme = 'gov'
constructor(private storageservice: StorageService) { }
setTheme(theme: 'gov' | 'default' | 'tribunal') {
document.body.classList.remove("gov");
document.body.classList.remove("default");
document.body.classList.remove("tribunal");
document.body.classList.add(theme);
this.currentTheme = theme
this.storageservice.store('theme',theme);
}
}