Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Angular - Remove mat-expansion-panel border & box-shadow

Is there any way to remove the border, I think it's the box-shadow of a mat-expansion-panel from Angular Material? I want it to be all white, so you only would see Text and expansion arrow

<mat-accordion>
 <mat-expansion-panel class="" (opened)="panelOpenState = true"
                   (closed)="panelOpenState = false">

   <mat-expansion-panel-header>

     <mat-panel-title>
       <span class="right">Filter</span>
     </mat-panel-title>

   </mat-expansion-panel-header>

   <p><app-data></app-data></p>

 </mat-expansion-panel>
</mat-accordion>

Mat-Panel

like image 546
Sergi Avatar asked Aug 06 '18 19:08

Sergi


3 Answers

add mat-elevation-z0 class. Works like a charm, I needed to use that recently.

<mat-accordion>
 <mat-expansion-panel class="mat-elevation-z0" (opened)="panelOpenState = true"
                   (closed)="panelOpenState = false">

   <mat-expansion-panel-header>

     <mat-panel-title>
       <span class="right">Filter</span>
     </mat-panel-title>

   </mat-expansion-panel-header>

   <p><app-data></app-data></p>

 </mat-expansion-panel>
</mat-accordion>
like image 94
Tomasz Błachut Avatar answered Oct 07 '22 14:10

Tomasz Błachut


I do it with css:

.mat-expansion-panel:not([class*='mat-elevation-z']) {
    box-shadow: none;
}
like image 16
JBeen Avatar answered Oct 07 '22 15:10

JBeen


Yes, You can remove box-shadow and border: Just Put in CSS or SCSS (Real-time work)

.mat-expansion-panel{
    box-shadow: none !important;
}
like image 4
Sarfo Avatar answered Oct 07 '22 13:10

Sarfo