I hava an angular 4.4.4 application with material 2.0.0-beta.12
and I want to use the mat-expansion-panel
from material design.
This is my code
In your style.css
or your components style you need to add the following css:
/deep/ .parametersPanel .mat-expansion-panel-body {
padding: 0;
}
This is due to view encapsulation. You can read more about this here: https://angular.io/guide/component-styles
Update:
The use of /deep/
, ::ng-deep
to modify the styles of material components has been deprecated. See this link.
However, using @angular/core
^6.1.0
and @angular/material
^6.4.6
I was able to change the style of Angular Material's Expansion panel without having to add anything specific. It seems like you can now simply change the style in your components css file. So this should work:
.mat-expansion-panel-body {
padding: 0;
}
You can read here for more information about the deprecation of /deep/
, ::ng-deep
here.