MatBlazor icon indicating copy to clipboard operation
MatBlazor copied to clipboard

how to set the width for a Dialog

Open lakani opened this issue 6 years ago • 7 comments
trafficstars

is there is a way to set the width of a Dialog to be stretched based on the content or even given a fixed value Screenshot_2019-07-07 TestMatBlazor

lakani avatar Jul 07 '19 08:07 lakani

Thanks for your issue/idea. In the near future will be implemented.

SamProf avatar Aug 04 '19 13:08 SamProf

@lakani By default the dialog surface is set to a max-width of 560px. My work-around was to create my own css file that loads after MatBlazor with the below to override.

.mdc-dialog .mdc-dialog__surface { max-width: none; }

DouglasRiddle avatar Oct 10 '19 19:10 DouglasRiddle

No news ?

I tried :

    <style>
        mdc-dialog .mdc-dialog__surface {
            width: 500px;
        }
    </style>

But it doesn't seems to work :-P

vd3d avatar Jan 01 '20 23:01 vd3d

No news ?

I tried :

    <style>
        mdc-dialog .mdc-dialog__surface {
            width: 500px;
        }
    </style>

But it doesn't seems to work :-P

It needs to be .mdc-dialog as it is a class.

DouglasRiddle avatar Jan 02 '20 00:01 DouglasRiddle

No news ?

I tried :

    <style>
        mdc-dialog .mdc-dialog__surface {
            width: 500px;
        }
    </style>

But it doesn't seems to work :-P

You need to load the file that overrides MatBlazor css after you have loaded matBlazor.css. If you load your file before you need to specify !important like this:

.mdc-dialog .mdc-dialog__surface {
    max-width: none !important;
}

Ogglas avatar Jan 14 '22 23:01 Ogglas

Any update on this feature?

Welchen avatar Jul 21 '23 15:07 Welchen

this has probably changed now the correct css override is

.mud-dialog-width-sm{
    max-width: none !important;
}
 

EmilAlipiev avatar Dec 11 '23 20:12 EmilAlipiev