Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set Styles for disabled Mat-Expansion Panel

I was wondering if there was a way to set the styling for a Mat-Expansion-Panel that's been disabled. I have buttons in the header and interacting with them toggles the panel so I believe it better to just toggle the panel with a button and disable the panel itself.

However, when I disable the panel it grey's out all the items inside the panel. Is there a way to remove the disable styles or overwrite them?

like image 906
Haq.H Avatar asked Dec 21 '25 21:12

Haq.H


1 Answers

Using the following in your component style sheet will return the disabled expansion panel color back to default.

::ng-deep .mat-expansion-panel-header[aria-disabled=true] {
    color: rgba(0,0,0,.87);
}

Per this SO answer, until an alternative or replacement is provided for ::ng-deep the recommendation is to continue using it...

What to use in place of ::ng-deep

like image 184
Marshal Avatar answered Dec 24 '25 11:12

Marshal



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!