Skip to content

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

Closed

Description

@willshowell

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

Activity

  1. added
    feature
    on May 18, 2017
  2. willshowell commented on May 31, 2017

    @willshowell
    ContributorAuthor

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

  3. jelbourn commented on May 31, 2017

    @jelbourn
    Contributor

    Sounds good to me

  4. zdendapa commented on Jun 30, 2018

    @zdendapa

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

  5. no-more commented on Aug 28, 2018

    @no-more

    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.

  6. willshowell commented on Aug 28, 2018

    @willshowell
    ContributorAuthor

    @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

  7. no-more commented on Aug 28, 2018

    @no-more

    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.

  8. angular-automatic-lock-bot commented on Sep 9, 2019

    @angular-automatic-lock-bot

    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.

  9. locked and limited conversation to collaborators on Sep 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions