mirror of
https://github.com/GNS3/gns3-web-ui.git
synced 2025-02-21 02:01:19 +00:00
fix for styling dafult layout
This commit is contained in:
parent
6c4cdb06b2
commit
767dc0c963
@ -1,4 +1,4 @@
|
||||
<div class="dark">
|
||||
<router-outlet class="dark"></router-outlet>
|
||||
<div [ngClass]="{dark: darkThemeEnabled, light: !darkThemeEnabled}">
|
||||
<router-outlet></router-outlet>
|
||||
<app-notification-box></app-notification-box>
|
||||
</div>
|
||||
|
@ -5,3 +5,7 @@ mat-menu-panel {
|
||||
.dark {
|
||||
background: #263238!important;
|
||||
}
|
||||
|
||||
.light {
|
||||
background: white!important;
|
||||
}
|
||||
|
@ -14,6 +14,8 @@ import { OverlayContainer} from '@angular/cdk/overlay';
|
||||
styleUrls: ['./app.component.scss']
|
||||
})
|
||||
export class AppComponent implements OnInit {
|
||||
public darkThemeEnabled: boolean = false;
|
||||
|
||||
constructor(
|
||||
private overlayContainer: OverlayContainer,
|
||||
iconReg: MatIconRegistry,
|
||||
@ -48,6 +50,11 @@ export class AppComponent implements OnInit {
|
||||
}
|
||||
|
||||
applyTheme(theme: string) {
|
||||
if (theme === 'dark-theme') {
|
||||
this.darkThemeEnabled = true;
|
||||
} else {
|
||||
this.darkThemeEnabled = false;
|
||||
}
|
||||
this.overlayContainer.getContainerElement().classList.add(theme);
|
||||
this.componentCssClass = theme;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user