Recently diving into Angular 6 and facing an issue with my mat-toolbar integrated with mat-sidenav. Everything seems to be functioning fine, but I'm looking to customize the color for the active item in the side nav menu.
Currently, all items have a plain black background, but I want them to change color when selected from the mat-nav-list. Additionally, my attempts to set dividers between each item have been unsuccessful.
Here's a snippet of my app.component.html:
<mat-sidenav-container class="sidenav-container">
<mat-sidenav #drawer class="sidenav" fixedInViewport="true" [attr.role]="(isHandset$ | async) ? 'dialog' : 'navigation'"
[mode]="(isHandset$ | async) ? 'over' : 'side'" [opened]="!(isHandset$ | async)" style="background:black"> //current background is black
<mat-toolbar class="menuBar">Menus</mat-toolbar>
<mat-nav-list>
<a class="menuTextColor" mat-list-item href="#">Link 1</a> // want to change the color of the selected item.
<a class="menuTextColor" mat-list-item href="#">Link 2</a> // want to set divider between each item
<a class="menuTextColor" mat-list-item href="#">Link 3</a>
</mat-nav-list>
</mat-sidenav>
<mat-sidenav-content>
<mat-toolbar class="toolbar">
<button class="menuTextColor" type="button" aria-label="Toggle sidenav" mat-icon-button (click)="drawer.toggle()" *ngIf="isHandset$ | async">
<mat-icon aria-label="Side nav toggle icon">menu</mat-icon>
</button>
<span class="toolbarHeading">Demo App</span>
</mat-toolbar>
<!-- Add Content Here -->
</mat-sidenav-content>
</mat-sidenav-container>
If anyone has any insights on how to resolve these issues, please share!