assets/stylesheets/bootstrap/_modal.scss in bootstrap-4.0.0.beta vs assets/stylesheets/bootstrap/_modal.scss in bootstrap-4.0.0.beta2
- old
+ new
@@ -41,17 +41,21 @@
// 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;
}
// Actual modal
.modal-content {
position: relative;
display: flex;
flex-direction: column;
+ // 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;
@include border-radius($border-radius-lg);
@include box-shadow($modal-content-box-shadow-xs);
@@ -76,13 +80,20 @@
// Modal header
// Top section of the modal w/ title and dismiss
.modal-header {
display: flex;
- align-items: center; // vertically center it
+ align-items: flex-start; // so the close btn always stays on the upper right corner
justify-content: space-between; // Put modal header elements (title and dismiss) on opposite ends
padding: $modal-header-padding;
border-bottom: $modal-header-border-width solid $modal-header-border-color;
+ @include border-top-radius($border-radius-lg);
+
+ .close {
+ padding: $modal-header-padding;
+ // auto on the left force icon to the right even when there is no .modal-title
+ margin: (-$modal-header-padding) (-$modal-header-padding) (-$modal-header-padding) auto;
+ }
}
// Title text within header
.modal-title {
margin-bottom: 0;