1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

Disable the default hover effect of mat-button?

Discussão em 'Angular' iniciado por DaSomes, Maio 20, 2025.

  1. DaSomes

    DaSomes Guest

    I am currenlty playing a bit with Angular Material and made the Navbar below. Now I want to disable the hover effect (background color changes) of the buttons. I manage to change e.g. the background color to red on hovering, so I guess I have the right selectors, but e.g. background-color: transparent; doesnt work. The background of the button still becomes grey on hovering although the page is defaultly white.

    I know there are some other Stackoverflow Questions who asked this, but all of their answers won't work for me / some says they are already outdated for Angular 19.

    <mat-sidenav-container class="sidenav-container">
    <mat-sidenav #sidenav mode="over" [(opened)]="opened" (opened)="events.push('open!')">
    <button mat-button (click)="sidenav.close()"><mat-icon>menu</mat-icon></button>
    <mat-nav-list>
    <mat-list-item (click)="sidenav.close()" routerLink="/home">Dashboard</mat-list-item>
    <mat-list-item (click)="sidenav.close()" routerLink="/settings">Settings</mat-list-item>
    </mat-nav-list>
    </mat-sidenav>

    <mat-sidenav-content>
    <button mat-button (click)="sidenav.open()"><mat-icon>menu</mat-icon></button>
    <router-outlet></router-outlet>
    </mat-sidenav-content>
    </mat-sidenav-container>

    Continue reading...

Compartilhe esta Página