Vue-js-modal: Allow `vh` and `vw` units for width & height

Created on 1 Oct 2018  路  2Comments  路  Source: euvl/vue-js-modal

Problem:

I'd love to be be able to use the following:

<modal name="userLogin" :scrollable="true" width="100vw" height="100vh"></modal>

for a full-screen modal that I need to replicate in my design.

Example & screenshots:

I get the following error:

Is there any reason not to allow those units?

Thanks!

question

Most helpful comment

Those are not css values.

Those are totally legit values. I use vh and vw for my modals too, and since CSS is for styling and not code, I use !important to override what vue-js-modal is doing, like so:

image

Perfectly centered, dynamic modals via flexbox 馃帀. There's no reason to force users to specify exact pixel widths and heights for a modal in this day and age.

All 2 comments

if you will implement it - go for it. Those are not css values. width/height are recalculated if your modal draggable or resizable, or your screen size changes. It is more like "suggestion" to the modal, but the plugin itself has "fool" protection to make sure that, for example, your modal will not be bigger than screen or will not fly outside the viewport.

Those are not css values.

Those are totally legit values. I use vh and vw for my modals too, and since CSS is for styling and not code, I use !important to override what vue-js-modal is doing, like so:

image

Perfectly centered, dynamic modals via flexbox 馃帀. There's no reason to force users to specify exact pixel widths and heights for a modal in this day and age.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

smholsen picture smholsen  路  4Comments

Max64 picture Max64  路  4Comments

ar53n picture ar53n  路  4Comments

chris-rowe picture chris-rowe  路  4Comments

yyh1102 picture yyh1102  路  3Comments