mirror of
https://github.com/akveo/ngx-admin.git
synced 2026-03-14 09:26:13 +01:00
playing with colors
This commit is contained in:
parent
77a33d880b
commit
9fbe408c22
12 changed files with 121 additions and 114 deletions
|
|
@ -7,23 +7,29 @@ import {BaThemeConfigProvider, isMobile} from '../../../theme';
|
|||
})
|
||||
export class BaThemeRun {
|
||||
|
||||
@HostBinding('class.blur-theme') isBlur:boolean = false;
|
||||
@HostBinding('class.mobile') isMobile:boolean = false;
|
||||
private _classes:Array<string> = [];
|
||||
@HostBinding('class') classesString:string;
|
||||
|
||||
constructor(private _baConfig:BaThemeConfigProvider) {
|
||||
}
|
||||
|
||||
public ngOnInit():void {
|
||||
this._assignBlur();
|
||||
this._assignTheme();
|
||||
this._assignMobile();
|
||||
}
|
||||
|
||||
// TODO: assign any theme class, not only hardcoded blur
|
||||
private _assignBlur():void {
|
||||
this.isBlur = this._baConfig.get().theme.blur;
|
||||
private _assignTheme():void {
|
||||
this._addClass(this._baConfig.get().theme.name);
|
||||
}
|
||||
|
||||
private _assignMobile():void {
|
||||
this.isMobile = isMobile();
|
||||
if (isMobile()) {
|
||||
this._addClass('mobile');
|
||||
}
|
||||
}
|
||||
|
||||
private _addClass(cls:string) {
|
||||
this._classes.push(cls);
|
||||
this.classesString = this._classes.join(' ');
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue