Get rid of white space around Angular Material modal dialog code example

Example 1: Get rid of white space around Angular Material modal dialog

import {ViewEncapsulation} from '@angular/core';
    
@Component({
  .....,
  encapsulation: ViewEncapsulation.None 
})

Example 2: Get rid of white space around Angular Material modal dialog

.mat-dialog-container {
    padding: 0px !important;
}

Example 3: Get rid of white space around Angular Material modal dialog

.custom-dialog-container .mat-dialog-container {
    /* add your styles */
}

Example 4: Get rid of white space around Angular Material modal dialog

this.dialog.open(MyDialogComponent, { panelClass: 'custom-dialog-container' })