Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make a modal fullscreen?

I am trying to make a bootstrap vue modal fullscreen. Which css classes should I override, I want to do this in a scoped style in the component that will use this modal.

like image 963
ConfusedCoder Avatar asked Mar 25 '19 19:03

ConfusedCoder


1 Answers

You want to edit .modal-dialog and force the dimensions.

Example CSS:

.modal-dialog {
    max-width: 100%;
    margin: 0;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100vh;
    display: flex;
}

Additionally to get this working in vue. You can try adding a class to b-modal and trying something like this:

<div>
  <b-button v-b-modal.modal1>Launch demo modal</b-button>

  <!-- Modal Component -->
  <b-modal class="test-modal" id="modal1" title="BootstrapVue">
    <p class="my-4">Hello from modal!</p>
  </b-modal>
</div>

CSS:

.test-modal .modal-dialog {
    max-width: 100%;
    margin: 0;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100vh;
    display: flex;
    position: fixed;
    z-index: 100000;
}
like image 55
brooksrelyt Avatar answered Sep 18 '22 15:09

brooksrelyt