From c4c129869fd9b506e554b2d7ca5e37267111f2c2 Mon Sep 17 00:00:00 2001 From: Johannes Millan Date: Tue, 13 Nov 2018 18:22:04 +0100 Subject: [PATCH] fix: theme body class --- src/app/app.component.ts | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/app/app.component.ts b/src/app/app.component.ts index ed60635..30e03d3 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -91,13 +91,17 @@ export class AppComponent implements OnInit { this._overlayContainer.getContainerElement().classList.add(theme); this._el.nativeElement.classList.add(theme); - isDarkTheme - ? this._el.nativeElement.classList.add('isDarkTheme') - : this._el.nativeElement.classList.remove('isDarkTheme'); - - isDarkTheme - ? this._overlayContainer.getContainerElement().classList.add('isDarkTheme') - : this._overlayContainer.getContainerElement().classList.remove('isDarkTheme'); + if (isDarkTheme) { + this._el.nativeElement.classList.remove('isLightTheme'); + this._overlayContainer.getContainerElement().classList.remove('isLightTheme'); + this._el.nativeElement.classList.add('isDarkTheme'); + this._overlayContainer.getContainerElement().classList.add('isDarkTheme'); + } else { + this._el.nativeElement.classList.remove('isDarkTheme'); + this._overlayContainer.getContainerElement().classList.remove('isDarkTheme'); + this._el.nativeElement.classList.add('isLightTheme'); + this._overlayContainer.getContainerElement().classList.add('isLightTheme'); + } this._currentTheme = theme; }