UNPKG

rsuite

Version:

A suite of react components

166 lines (142 loc) 3.52 kB
@import '../../styles/common'; @import 'mixin'; // // Modals // -------------------------------------------------- // Modal background .rs-modal-backdrop { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; z-index: @zindex-modal - 1; background-color: var(--rs-bg-backdrop); // Fade for backdrop &.rs-anim-fade { opacity: 0; transition: opacity 0.3s ease-in; } &.rs-anim-in { opacity: 1; } } // Kill the scroll on the body .rs-modal-open { overflow: hidden; } .rs-modal-wrapper { position: fixed; overflow: auto; z-index: @zindex-modal; top: 0; left: 0; width: 100%; height: 100%; } // Container that the modal scrolls within .rs-modal { display: none; overflow: visible; // Prevent Chrome on Windows from adding a focus outline. For details, see // https://github.com/twbs/bootstrap/pull/10951. outline: 0; margin: 30px auto 0 auto; position: relative; width: auto; z-index: @zindex-modal; // Scale up the modal &-lg { .content-width(@modal-lg); } &-md { .content-width(@modal-md); } &-sm { .content-width(@modal-sm); } &-xs { .content-width(@modal-xs); } &-full { @modal-full-size-margin-value: @modal-full-size-margin* 2; .content-width(~'calc(100% - @{modal-full-size-margin-value})'); } } .rs-modal-shake .rs-modal-dialog { animation: 0.3s linear shakeHead; } // Actual modal .rs-modal-content { position: relative; background-color: var(--rs-bg-overlay); border: var(--rs-modal-border, none); border-radius: @modal-border-radius; // Remove focus outline from opened modal outline: 0; box-shadow: var(--rs-modal-shadow); padding: @modal-content-padding; } // Modal header // Top section of the modal w/ title and dismiss .rs-modal-header { .clearfix(); padding-right: @line-height-computed; .rs-modal-header-close { // button width the same to height @padding-right: 4px; position: absolute; right: @modal-content-padding; top: @modal-content-padding; font-size: @modal-close-btn-size; line-height: @modal-close-btn-line-height; color: @modal-close-btn-color; width: @line-height-computed; padding: 0 @padding-right; } } .rs-modal-title { font-weight: normal; font-size: @modal-title-font-size; line-height: unit((@line-height-computed / @modal-title-font-size)); width: 100%; display: block; color: var(--rs-text-heading); margin: 0; .ellipsis(); } // Modal body // Where all modal content resides (sibling of .modal-header and .modal-footer) .rs-modal-body { position: relative; margin-top: @modal-body-margin; // Make sure input error message don't overflow. padding-bottom: @modal-body-margin; } // Footer (for actions) .rs-modal-footer { text-align: right; // right align buttons border-top: none; .clearfix(); // clear it in case folks use .pull-* classes on buttons // Properly space out buttons .rs-btn + .rs-btn { margin-left: 10px; margin-bottom: 0; // account for input[type="submit"] which gets the bottom margin like all other inputs } // but override that for button groups .rs-btn-group .rs-btn + .rs-btn { margin-left: -1px; } // and override it for block buttons as well .rs-btn-block + .rs-btn-block { margin-left: 0; } } // Measure scrollbar width for padding body during modal show/hide .rs-modal-scrollbar-measure { position: absolute; top: -9999px; width: 50px; height: 50px; overflow: scroll; }