I have an Angular Material 7 Expansion Panel. When I hover over one of the mat-expansion-panel-header the color is changing. How can I change this color?
Code:
<mat-accordion>
<mat-expansion-panel>
<mat-expansion-panel-header>
<mat-panel-title>
Titel
</mat-panel-title>
<mat-panel-description>Hi</mat-panel-description>
</mat-expansion-panel-header>
Content
</mat-expansion-panel>
</mat-accordion>
You can add a class to the header and set background color to currentColor on hover something like
<mat-accordion>
<mat-expansion-panel>
<mat-expansion-panel-header class="disable_ripple">
<mat-panel-title>
Titel
</mat-panel-title>
<mat-panel-description>Hi</mat-panel-description>
</mat-expansion-panel-header>
Content
</mat-expansion-panel>
</mat-accordion>
then in css
.disable_ripple:hover{
background: currentColor !important;
}
Working example
Add this to your component CSS file
mat-expansion-panel-header:hover {
background-color: currentColor
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With