assets/stylesheets/bootstrap/_modal.scss in bootstrap-4.0.0.beta2.1 vs assets/stylesheets/bootstrap/_modal.scss in bootstrap-4.0.0.beta3

- old
+ new

@@ -24,36 +24,46 @@ outline: 0; // We deliberately don't use `-webkit-overflow-scrolling: touch;` due to a // gnarly iOS Safari bug: https://bugs.webkit.org/show_bug.cgi?id=158342 // See also https://github.com/twbs/bootstrap/issues/17695 - // When fading in the modal, animate it to slide down - &.fade .modal-dialog { - @include transition($modal-transition); - transform: translate(0, -25%); + .modal-open & { + overflow-x: hidden; + overflow-y: auto; } - &.show .modal-dialog { transform: translate(0, 0); } } -.modal-open .modal { - overflow-x: hidden; - overflow-y: auto; -} // Shell div to position the modal with bottom padding .modal-dialog { position: relative; width: auto; margin: $modal-dialog-margin; // allow clicks to pass through for custom click handling to close modal pointer-events: none; + + // When fading in the modal, animate it to slide down + .modal.fade & { + @include transition($modal-transition); + transform: translate(0, -25%); + } + .modal.show & { + transform: translate(0, 0); + } } +.modal-dialog-centered { + display: flex; + align-items: center; + min-height: calc(100% - (#{$modal-dialog-margin} * 2)); +} + // Actual modal .modal-content { position: relative; display: flex; flex-direction: column; + width: 100%; // Ensure `.modal-content` extends the full width of the parent `.modal-dialog` // counteract the pointer-events: none; in the .modal-dialog pointer-events: auto; background-color: $modal-content-bg; background-clip: padding-box; border: $modal-content-border-width solid $modal-content-border-color; @@ -139,14 +149,19 @@ .modal-dialog { max-width: $modal-md; margin: $modal-dialog-margin-y-sm-up auto; } + .modal-dialog-centered { + min-height: calc(100% - (#{$modal-dialog-margin-y-sm-up} * 2)); + } + .modal-content { @include box-shadow($modal-content-box-shadow-sm-up); } .modal-sm { max-width: $modal-sm; } + } @include media-breakpoint-up(lg) { .modal-lg { max-width: $modal-lg; } }