Trying to mimic the look of the Material guide, I can't get the toolbar's shadow to be rendered atop the mat-sidenav-container element:
Page showing toolbar and sidenav, but drop shadow isn't visible:
Page showing the toolbar alone, the shadow is rendered:
See the HTML code, it can't be more simple. What am I missing? Thanks...
app.component.html
<mat-toolbar class="mat-elevation-z6" color="primary">
toolbar
</mat-toolbar>
<mat-sidenav-container >
<!-- Side menu -->
<mat-sidenav mode="side" opened="true">
<h3>Menu 1</h3>
<ul>
<!-- Home (aka dashboard) -->
<li>
<a routerLink="/">dashboard</a>
</li>
<!-- Home (aka dashboard) -->
<li>
<a routerLink="/resolutions">resolutions</a>
</li>
</ul>
<!-- List resolutions -->
<h3>Menu 2</h3>
<ul>
<li>
<a>incentive</a>
</li>
</ul>
</mat-sidenav>
<!-- Routed contents -->
<div class="contents">
<router-outlet></router-outlet>
</div>
</mat-sidenav-container>
had the exact same issue. I resolved it by adding the following class in my CSS:
.sidenav-container {
z-index: -1 !important;
}
and added it to the mat-sidenav-container
<mat-sidenav-container class="sidenav-container">
...
</mat-sidenav-container>