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
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: translate(0, -25%);
49 transform: translate(0, 0);
53 .modal-dialog-centered {
56 min-height: calc(100% - (#{$modal-dialog-margin} * 2));
63 flex-direction: column;
64 width: 100%; // Ensure `.modal-content` extends the full width of the parent `.modal-dialog`
65 // counteract the pointer-events: none; in the .modal-dialog
67 background-color: $modal-content-bg;
68 background-clip: padding-box;
69 border: $modal-content-border-width solid $modal-content-border-color;
70 @include border-radius($border-radius-lg);
71 @include box-shadow($modal-content-box-shadow-xs);
72 // Remove focus outline from opened modal
83 z-index: $zindex-modal-backdrop;
84 background-color: $modal-backdrop-bg;
87 &.fade { opacity: 0; }
88 &.show { opacity: $modal-backdrop-opacity; }
92 // Top section of the modal w/ title and dismiss
95 align-items: flex-start; // so the close btn always stays on the upper right corner
96 justify-content: space-between; // Put modal header elements (title and dismiss) on opposite ends
97 padding: $modal-header-padding;
98 border-bottom: $modal-header-border-width solid $modal-header-border-color;
99 @include border-top-radius($border-radius-lg);
102 padding: $modal-header-padding;
103 // auto on the left force icon to the right even when there is no .modal-title
104 margin: (-$modal-header-padding) (-$modal-header-padding) (-$modal-header-padding) auto;
108 // Title text within header
111 line-height: $modal-title-line-height;
115 // Where all modal content resides (sibling of .modal-header and .modal-footer)
118 // Enable `flex-grow: 1` so that the body take up as much space as possible
119 // when should there be a fixed height on `.modal-dialog`.
121 padding: $modal-inner-padding;
124 // Footer (for actions)
127 align-items: center; // vertically center
128 justify-content: flex-end; // Right align buttons with flex property because text-align doesn't work on flex items
129 padding: $modal-inner-padding;
130 border-top: $modal-footer-border-width solid $modal-footer-border-color;
132 // Easily place margin between footer elements
133 > :not(:first-child) { margin-left: .25rem; }
134 > :not(:last-child) { margin-right: .25rem; }
137 // Measure scrollbar width for padding body during modal show/hide
138 .modal-scrollbar-measure {
146 // Scale up the modal
147 @include media-breakpoint-up(sm) {
148 // Automatically set modal's width for larger viewports
150 max-width: $modal-md;
151 margin: $modal-dialog-margin-y-sm-up auto;
154 .modal-dialog-centered {
155 min-height: calc(100% - (#{$modal-dialog-margin-y-sm-up} * 2));
159 @include box-shadow($modal-content-box-shadow-sm-up);
162 .modal-sm { max-width: $modal-sm; }
166 @include media-breakpoint-up(lg) {
167 .modal-lg { max-width: $modal-lg; }