angular-custom-modal icon indicating copy to clipboard operation
angular-custom-modal copied to clipboard

Set the size when component inside

Open mrjohnr opened this issue 6 years ago • 3 comments

Hi.it is possible to set the size when have component inside,for example I want to use it for edit data (large size) or for simple dialogs (small size)? I want to put inline form inside:

<form class="form-inline" action="/action_page.php">
    <label for="email">Email address:</label>
    <input type="email" class="form-control" id="email">
    <label for="pwd">Password:</label>
    <input type="password" class="form-control" id="pwd">
    <div class="form-check">
        <label class="form-check-label">
            <input class="form-check-input" type="checkbox"> Remember me
        </label>
    </div>
    <button type="submit" class="btn btn-primary">Submit</button>
</form>

for me it looks very small : https://i.imgur.com/RNlDrpb.png thanks

mrjohnr avatar Apr 28 '18 16:04 mrjohnr

Hey @mrjohnr

You can set the modal size to whatever you want. Otherwise it'll be the content inside it the one deciding over the minimum width and height.

For example, I have a medium-sized modal with the following style:

.modal-dialog {
  width: 80%;
  max-width: 750px;
  height: 80%;
}

zurfyx avatar May 02 '18 13:05 zurfyx

thanks.for the modal it seems that css works only when it is put in general syle.css it would be fine to can be configured inside current component thanks

mrjohnr avatar May 03 '18 17:05 mrjohnr

Ah, that's probably because Angular by default generates CSS that targets only that component (i.e. .some-class[_ngcontent-c18]). Hence, it will not match if the modal component is its parent.

You have to prefix it with /deep/ if you want it to match the global scope.

/deep/ .modal-dialog { ... }

zurfyx avatar May 04 '18 11:05 zurfyx