I have the following css in my component's css file:
.mat-expansion-panel-body {
padding: 0;
}
And, so I would expect to see this rule (even if overridden) to show up for the following dom element:
<div class="mat-expansion-panel-body">...</div>
But, all I see being applied in dev tools is:
.mat-expansion-panel-body {
padding: 0 24px 16px;
}
I noticed that this element does not have the _ngcontent-c19 class that the other host elements do, and so I assume this is a case of view encapsulation.
However, after reading around with the deprecation of ::ng-deep and /deep/ and other encapsulation piercing constructs to be deprecated, what is a better solution to styling this element from within my component's css file?
from Angular Material mat-expansion-panel-body style not being applied
No comments:
Post a Comment