Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MdDialog container padding does not match spec #2735

Closed
LOZORD opened this issue Jan 20, 2017 · 9 comments
Closed

MdDialog container padding does not match spec #2735

LOZORD opened this issue Jan 20, 2017 · 9 comments
Assignees
Labels
P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent

Comments

@LOZORD
Copy link
Contributor

LOZORD commented Jan 20, 2017

Bug, feature request, or proposal:

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).

What is the expected behavior?

It should only pad the non-action content. Source

What is the current behavior?

It pads all the content.
screenshot from 2017-01-20 11 20 43

What are the steps to reproduce?

See here.

What is the use-case or motivation for changing an existing behavior?

To match the Material spec.

Which versions of Angular, Material, OS, browsers are affected?

Angular & Material: current
OS: any/all

Is there anything else we should know?

n/a

@jelbourn jelbourn added the P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent label Jan 20, 2017
d1i1m1o1n added a commit to d1i1m1o1n/material2 that referenced this issue Jan 21, 2017
@Haske107
Copy link

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.

@prabhat112
Copy link

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.

@Viktor-Bredihin
Copy link

as a workaround you can put this to your global styles (src/styles.css)
.mat-dialog-container {
padding: 0 !important;
}

@arzazahrian
Copy link

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 ?

@yhalwani
Copy link

yhalwani commented Jan 3, 2018

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

@Xapuu
Copy link

Xapuu commented Feb 23, 2018

Here is my solution, which i think will work for most of the cases, without messing with the view encapsulation prop.

  • First set custom class on your dialog box
this.dialog.open(myDialogComponent, {
  panelClass: 'my-dialog'
 });
  • Second - put the custom css in your global style.scss and target whatever you feel like (the container in this case)
.my-dialog {
    .mat-dialog-container {
		padding: 0;
		background: none;
                 {{And all the rest of the css you need}}
     }
}

@AMohamedZaki
Copy link

AMohamedZaki commented Apr 10, 2018

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'})

@jelbourn
Copy link
Member

jelbourn commented May 9, 2018

Closing this issue since the 2018 updates to the Material Design spec will supersede what's described here.

@jelbourn jelbourn closed this as completed May 9, 2018
@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Projects
None yet
Development

No branches or pull requests

10 participants