Angular2 Material Dialog css, dialog size

前端 未结 11 975
甜味超标
甜味超标 2020-12-25 10:52

Angular2 material team recently released the MDDialog https://github.com/angular/material2/blob/master/src/lib/dialog/README.md

I\'d like to change the looking and f

11条回答
  •  醉酒成梦
    2020-12-25 11:43

    With current version of Angular Material (6.4.7) you can use a custom class:

    let dialogRef = dialog.open(UserProfileComponent, {
      panelClass: 'my-class'
    });
    

    Now put your class somewhere global (haven't been able to make this work elsewhere), e.g. in styles.css:

    .my-class .mat-dialog-container{
      height: 400px;
      width: 600px;
      border-radius: 10px;
      background: lightcyan;
      color: #039be5;
    }
    

    Done!

提交回复
热议问题