I want the header of the MudExpansionPanel to be a different colour to the body of the content on the panel.
The MudExpansionPanel has the colour pink assigned in the Style attributes.
<MudExpansionPanel Text="Heading text" Style="@($"background-color:pink; color:black">
This turns the entire panel (including when it is expanded). I just want the heading to change colour.
How could I implement this?
2
Answers
First, add a custom CSS file to the project and register it in the
index.html
or_Host.cshtml
Pay attention to the priority of CSS files
Then apply your desired styles as below
To answer your question specifically, in addition to Taqi ツ above, you can target the elements inside the MudExpansionPanel element like this:
Instead of ‘*’ above, you can use class or other valid identifier.