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
8 // Kill the scroll on the body
17 // Container that the modal scrolls within
22 z-index: $zindex-modal;
27 // Prevent Chrome on Windows from adding a focus outline. For details, see
28 // https://github.com/twbs/bootstrap/pull/10951.
30 // We deliberately don't use `-webkit-overflow-scrolling: touch;` due to a
31 // gnarly iOS Safari bug: https://bugs.webkit.org/show_bug.cgi?id=158342
32 // See also https://github.com/twbs/bootstrap/issues/17695
35 // Shell div to position the modal with bottom padding
39 margin: $modal-dialog-margin;
40 // allow clicks to pass through for custom click handling to close modal
43 // When fading in the modal, animate it to slide down
45 @include transition($modal-transition);
46 transform: $modal-fade-transform;
49 transform: $modal-show-transform;
53 .modal-dialog-centered {
56 min-height: calc(100% - (#{$modal-dialog-margin} * 2));
58 // Ensure `modal-dialog-centered` extends the full height of the view (IE10/11)
60 display: block; // IE10
61 height: calc(100vh - (#{$modal-dialog-margin} * 2));
70 flex-direction: column;
71 width: 100%; // Ensure `.modal-content` extends the full width of the parent `.modal-dialog`
72 // counteract the pointer-events: none; in the .modal-dialog
74 background-color: $modal-content-bg;
75 background-clip: padding-box;
76 border: $modal-content-border-width solid $modal-content-border-color;
77 @include border-radius($modal-content-border-radius);
78 @include box-shadow($modal-content-box-shadow-xs);
79 // Remove focus outline from opened modal
88 z-index: $zindex-modal-backdrop;
91 background-color: $modal-backdrop-bg;
94 &.fade { opacity: 0; }
95 &.show { opacity: $modal-backdrop-opacity; }
99 // Top section of the modal w/ title and dismiss
102 align-items: flex-start; // so the close btn always stays on the upper right corner
103 justify-content: space-between; // Put modal header elements (title and dismiss) on opposite ends
104 padding: $modal-header-padding;
105 border-bottom: $modal-header-border-width solid $modal-header-border-color;
106 @include border-top-radius($modal-content-border-radius);
109 padding: $modal-header-padding;
110 // auto on the left force icon to the right even when there is no .modal-title
111 margin: (-$modal-header-padding-y) (-$modal-header-padding-x) (-$modal-header-padding-y) auto;
115 // Title text within header
118 line-height: $modal-title-line-height;
122 // Where all modal content resides (sibling of .modal-header and .modal-footer)
125 // Enable `flex-grow: 1` so that the body take up as much space as possible
126 // when should there be a fixed height on `.modal-dialog`.
128 padding: $modal-inner-padding;
131 // Footer (for actions)
134 align-items: center; // vertically center
135 justify-content: flex-end; // Right align buttons with flex property because text-align doesn't work on flex items
136 padding: $modal-inner-padding;
137 border-top: $modal-footer-border-width solid $modal-footer-border-color;
138 @include border-bottom-radius($modal-content-border-radius);
140 // Easily place margin between footer elements
141 > :not(:first-child) { margin-left: .25rem; }
142 > :not(:last-child) { margin-right: .25rem; }
145 // Measure scrollbar width for padding body during modal show/hide
146 .modal-scrollbar-measure {
154 // Scale up the modal
155 @include media-breakpoint-up(sm) {
156 // Automatically set modal's width for larger viewports
158 max-width: $modal-md;
159 margin: $modal-dialog-margin-y-sm-up auto;
162 .modal-dialog-centered {
163 min-height: calc(100% - (#{$modal-dialog-margin-y-sm-up} * 2));
166 height: calc(100vh - (#{$modal-dialog-margin-y-sm-up} * 2));
171 @include box-shadow($modal-content-box-shadow-sm-up);
174 .modal-sm { max-width: $modal-sm; }
177 @include media-breakpoint-up(lg) {
180 max-width: $modal-lg;
184 @include media-breakpoint-up(xl) {
185 .modal-xl { max-width: $modal-xl; }