I am hoping to have the background of a mat-sidenav the same as my mat-toolbar - theme color.
In src\styles.scss I have:
@import '~@angular/material/prebuilt-themes/indigo-pink.css';
My template / HTML file has:
<mat-toolbar color="primary">
<button mat-icon-button (click)="sidenav.toggle()">
<mat-icon>menu</mat-icon>
</button>
Title text
</mat-toolbar>
That shows nicely as indigo menu bar with the menu icon and Title text.
Below I want a mat-sidenav (that will have menu items) and I expect the entire background of the mat-sidenav area have the same color as the:
<mat-toolbar color="primary">
which is indigo - defined by the theme.
The HTML code continues for rendering mat-sidenav:
<mat-sidenav-container>
<mat-sidenav #sidenav mode="side" opened>
<app-vertical-menu></app-vertical-menu> // renders the menu items
</mat-sidenav>
<mat-sidenav-content>
<div class="app-main-area">
<router-outlet></router-outlet>
</div>
</mat-sidenav-content>
</mat-sidenav-container>
The mat-sidenav background and colors are untouched by the applied theme and its background colors are blank.
I know I can style the mat-sidenav background within the component using class name in the template - e.g:
...
<mat-sidenav #sidenav2 mode="side" opened class="vertical-menu">
...
and in the style/scss file:
.vertical-menu {
background-color: navy !important;
}
But instead I want to apply the theme color of the default theme (e.g: indigo-pink.css), so the mat-sidenav background color is the same as the theme that we use to get our toolbar color