1 // .modal-open - body class for killing the scroll
2 // .modal - container to scroll within
3 // .modal-dialog - positioning shell for the actual modal
4 // .modal-content - actual modal w/ bg and corners and stuff
7 // Kill the scroll on the body
12 // Container that the modal scrolls within
19 z-index: $zindex-modal;
22 // Prevent Chrome on Windows from adding a focus outline. For details, see
23 // https://github.com/twbs/bootstrap/pull/10951.
25 // We deliberately don't use `-webkit-overflow-scrolling: touch;` due to a
26 // gnarly iOS Safari bug: https://bugs.webkit.org/show_bug.cgi?id=158342
27 // See also https://github.com/twbs/bootstrap/issues/17695
29 // When fading in the modal, animate it to slide down
30 &.fade .modal-dialog {
31 @include transition($modal-transition);
32 transform: translate(0, -25%);
34 &.show .modal-dialog { transform: translate(0, 0); }
41 // Shell div to position the modal with bottom padding
45 margin: $modal-dialog-margin;
52 flex-direction: column;
53 background-color: $modal-content-bg;
54 background-clip: padding-box;
55 border: $modal-content-border-width solid $modal-content-border-color;
56 @include border-radius($border-radius-lg);
57 @include box-shadow($modal-content-xs-box-shadow);
58 // Remove focus outline from opened modal
69 z-index: $zindex-modal-backdrop;
70 background-color: $modal-backdrop-bg;
73 &.fade { opacity: 0; }
74 &.show { opacity: $modal-backdrop-opacity; }
78 // Top section of the modal w/ title and dismiss
81 align-items: center; // vertically center it
82 justify-content: space-between; // Put modal header elements (title and dismiss) on opposite ends
83 padding: $modal-header-padding;
84 border-bottom: $modal-header-border-width solid $modal-header-border-color;
87 // Title text within header
90 line-height: $modal-title-line-height;
94 // Where all modal content resides (sibling of .modal-header and .modal-footer)
97 // Enable `flex-grow: 1` so that the body take up as much space as possible
98 // when should there be a fixed height on `.modal-dialog`.
100 padding: $modal-inner-padding;
103 // Footer (for actions)
106 align-items: center; // vertically center
107 justify-content: flex-end; // Right align buttons with flex property because text-align doesn't work on flex items
108 padding: $modal-inner-padding;
109 border-top: $modal-footer-border-width solid $modal-footer-border-color;
111 // Easily place margin between footer elements
112 > :not(:first-child) { margin-left: .25rem; }
113 > :not(:last-child) { margin-right: .25rem; }
116 // Measure scrollbar width for padding body during modal show/hide
117 .modal-scrollbar-measure {
125 // Scale up the modal
126 @include media-breakpoint-up(sm) {
127 // Automatically set modal's width for larger viewports
129 max-width: $modal-md;
130 margin: $modal-dialog-sm-up-margin-y auto;
134 @include box-shadow($modal-content-sm-up-box-shadow);
137 .modal-sm { max-width: $modal-sm; }
140 @include media-breakpoint-up(lg) {
141 .modal-lg { max-width: $modal-lg; }