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

Proposal: Ability to add extra class(es) to dialog container #4653

Closed
willshowell opened this issue May 18, 2017 · 7 comments
Closed

Proposal: Ability to add extra class(es) to dialog container #4653

willshowell opened this issue May 18, 2017 · 7 comments
Labels
feature This issue represents a new feature or feature request rather than a bug or bug fix

Comments

@willshowell
Copy link
Contributor

Bug, feature request, or proposal:

Proposal

Use Case 1:

I have a dialog that I want to be full-bleed (in my case, it contains just a map)

this.dialog.open(MyMapDialogComponent, { containerClass: 'full-bleed' })

.mat-dialog.container.full-bleed {
  padding: 0;
}

Use Case 2:

I want to make my dialog full screen:

this.dialog.open(MyBigDialogComponent, { containerClass: 'full-screen' })

.mat-dialog-container.full-screen {
  max-width: none;
  width: 100vw;
  height: 100vh;
}

This wouldn't be too different from backdropClass or snackbar's extraClasses and it would solve #3209

@jelbourn jelbourn added the feature This issue represents a new feature or feature request rather than a bug or bug fix label May 18, 2017
@willshowell
Copy link
Contributor Author

@jelbourn With the addition of panelClass in #4722, I'm able to achieve what I want. Happy to close unless you see any value in also being able to add classes to the dialog container.

@jelbourn
Copy link
Member

Sounds good to me

@zdendapa
Copy link

its not perfect, but fast solution
/deep/ .mat-dialog-container {
padding: 0;
}

@no-more
Copy link

no-more commented Aug 28, 2018

I know this thread is closed but I was wondering if it's possible to add a class from within the dialog component ?
The panelClass configuration needs to be used everywhere I want to call the dialog, but my need is to apply the same class all the time so it's quite redundant. I was looking for something like "host" solution for component.

Thanks.

@willshowell
Copy link
Contributor Author

@no-more you might be interested in using MAT_DIALOG_DEFAULT_OPTIONS if you want to apply the class to all dialogs, or maybe follow #6206 since it would provide the ability to modify the panelClass

@no-more
Copy link

no-more commented Aug 28, 2018

Thanks for your fast response.
I'll follow the other thread as my need is to be able to apply one or more class to a specific dialog component(all instances of this components) and not to all my dialogs.

@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 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature This issue represents a new feature or feature request rather than a bug or bug fix
Projects
None yet
Development

No branches or pull requests

4 participants