I would like to size a modal from the TS File and not by the Global SCSS File.
There is a simple code where you size the modal by the Global SCSS File.
HTML File
<ion-content>
<ion-button expand="block" fill="outline" (click)="onModal()">
<ion-icon name="apps"></ion-icon>
</ion-button>
</ion-content>
TS File:
export class HomePage {
constructor(private modalController: ModalController) {}
onModal() {
this.dynamicPreview('Dynamic Modal');
}
async dynamicPreview(info: any) {
const myModal = await this.modalController.create({
component: DynamicModalPage,
cssClass: 'dynamicModalCss',
componentProps: {
vInfo: info,
}
});
return await myModal.present();
}
}
Global SCSS File:
.dynamicModalCss {
left: 0;
right: 0;
top: 0;
bottom: 0;
position: absolute;
contain: strict;
display: flex;
justify-content: center;
align-items: center;
.modal-wrapper {
width: 20rem;
height: 40rem;
}
}
I have no idea about how to do this
Thanks for your suggestions and help