1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-08-20 12:21:35 +02:00

Scrollable modal (#27769)

This commit is contained in:
Shohei Yoshida
2019-01-21 06:28:16 +09:00
committed by XhmikosR
parent 41f85b64bf
commit de0bb1e052
4 changed files with 182 additions and 6 deletions

View File

@@ -50,17 +50,51 @@
}
}
.modal-dialog-scrollable {
display: flex; // IE10/11
max-height: calc(100% - #{$modal-dialog-margin * 2});
.modal-content {
max-height: calc(100vh - #{$modal-dialog-margin * 2}); // IE10/11
overflow: hidden;
}
.modal-header,
.modal-footer {
flex-shrink: 0;
}
.modal-body {
overflow-y: auto;
}
}
.modal-dialog-centered {
display: flex;
align-items: center;
min-height: calc(100% - (#{$modal-dialog-margin} * 2));
min-height: calc(100% - #{$modal-dialog-margin * 2});
// Ensure `modal-dialog-centered` extends the full height of the view (IE10/11)
&::before {
display: block; // IE10
height: calc(100vh - (#{$modal-dialog-margin} * 2));
height: calc(100vh - #{$modal-dialog-margin * 2});
content: "";
}
// Ensure `.modal-body` shows scrollbar (IE10/11)
&.modal-dialog-scrollable {
flex-direction: column;
justify-content: center;
height: 100%;
.modal-content {
max-height: none;
}
&::before {
content: none;
}
}
}
// Actual modal
@@ -159,11 +193,19 @@
margin: $modal-dialog-margin-y-sm-up auto;
}
.modal-dialog-scrollable {
max-height: calc(100% - #{$modal-dialog-margin-y-sm-up * 2});
.modal-content {
max-height: calc(100vh - #{$modal-dialog-margin-y-sm-up * 2});
}
}
.modal-dialog-centered {
min-height: calc(100% - (#{$modal-dialog-margin-y-sm-up} * 2));
min-height: calc(100% - #{$modal-dialog-margin-y-sm-up * 2});
&::before {
height: calc(100vh - (#{$modal-dialog-margin-y-sm-up} * 2));
height: calc(100vh - #{$modal-dialog-margin-y-sm-up * 2});
}
}