MdDialog (<md-dialog-container>) currently pads the entire child (user-supplied) content with 24px.
It should not pad the action content (or rather, pad according to the spec).
It should only pad the non-action content. Source

It pads all the content.

See here.
To match the Material spec.
Angular & Material: current
OS: any/all
n/a
Have we found a fix for this? I can remove the 24px padding via Chrome Dev Tools as .mat-dialog-container but not within CSS.
I need to remove the padding on the mat-dialog-container which is now default at 24px. Pls suggest if any way to remove or override it.
as a workaround you can put this to your global styles (src/styles.css)
.mat-dialog-container {
padding: 0 !important;
}
i have more than 1 dialog if im using :
.mat-dialog-container {
padding: 0 !important;
}
all my dialog padding is 0
how to specify the padding is 0 on the selected dialog ?
Try this work around, its a bit extreme having to use view encapsulation but worked for me. https://stackoverflow.com/questions/42306850/need-to-find-css-selector-for-material-design-2s-md-dialog-container
Here is my solution, which i think will work for most of the cases, without messing with the view encapsulation prop.
this.dialog.open(myDialogComponent, {
panelClass: 'my-dialog'
});
.my-dialog {
.mat-dialog-container {
padding: 0;
background: none;
{{And all the rest of the css you need}}
}
}
you can Simply check this to remove the useless padding
// Add this to your global stylesheet after your theme setup
.myapp-no-padding-dialog .mat-dialog-container {
padding: 0;
}
this.dialog.open(MyDialogComponent, {panelClass: 'myapp-no-padding-dialog'})
Closing this issue since the 2018 updates to the Material Design spec will supersede what's described here.
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
_This action has been performed automatically by a bot._
Most helpful comment
Have we found a fix for this? I can remove the 24px padding via Chrome Dev Tools as .mat-dialog-container but not within CSS.