Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set up the max-width of $mdDialog?

I'm a new one in css and can not to set up the max-width of my confirmation dialog properly. Here my code of calling dialog:

this.$mdDialog.show({
  content: longText,
  ok: 'OK',
  cancel: 'CANCEL'
  clickOutsideToClose: true,
});

The problem is that my longText doesn't carry and my dialog is very stretched horizontally. I tried to add style.less locally and determine max-width like this:

.md-dialog {
  max-width: 300px;
}

But there is no changes. Could some one help me?

like image 290
user3818229 Avatar asked Jul 08 '16 19:07

user3818229


2 Answers

To achieve what you want you should use this way:

.md-dialog-content {
  max-width: 300px;
}
like image 197
developer033 Avatar answered Sep 19 '22 02:09

developer033


you can try

md-dialog{
max-width: 300px;
}

because md-dialog is not a class it is directive which angular material predefine

like image 39
Aravind Reddy Avatar answered Sep 22 '22 02:09

Aravind Reddy