_modals.scss 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. $zindex-modal-background: 500;
  2. .fade {
  3. @include transition(opacity 0.15s linear);
  4. opacity: 0;
  5. &.in {
  6. opacity: 1;
  7. }
  8. }
  9. // Kill the scroll on the body
  10. .modal-open {
  11. overflow: hidden;
  12. .content-wrapper {
  13. transform: none;
  14. }
  15. }
  16. // Container that the modal scrolls within
  17. .modal {
  18. box-sizing: border-box;
  19. display: none;
  20. overflow: auto;
  21. overflow-y: scroll;
  22. position: fixed;
  23. top: 0;
  24. right: 0;
  25. bottom: 0;
  26. left: 0;
  27. z-index: $zindex-modal-background;
  28. }
  29. // Shell div to position the modal with bottom padding
  30. .modal-dialog {
  31. box-sizing: border-box;
  32. margin-left: auto;
  33. margin-right: auto;
  34. padding: 0;
  35. z-index: ($zindex-modal-background + 10);
  36. height: 90%;
  37. width: 85%;
  38. &:before {
  39. content: '';
  40. display: inline-block;
  41. height: 100%;
  42. vertical-align: middle;
  43. margin-right: -0.25em;
  44. }
  45. }
  46. // Actual modal
  47. .modal-content {
  48. box-sizing: border-box;
  49. border-radius: 3px;
  50. width: 98.7%;
  51. position: relative;
  52. background-color: $color-white;
  53. margin-top: 2em;
  54. padding-bottom: 3em;
  55. display: inline-block;
  56. vertical-align: middle;
  57. overflow: hidden;
  58. }
  59. // Modal background
  60. .modal-backdrop {
  61. position: fixed;
  62. top: 0;
  63. right: 0;
  64. bottom: 0;
  65. left: 0;
  66. z-index: ($zindex-modal-background - 10);
  67. background-color: $color-black;
  68. // Fade for backdrop
  69. &.fade { opacity: 0; }
  70. &.in { opacity: 0.5; }
  71. }
  72. .modal .close {
  73. padding: 0;
  74. position: absolute;
  75. width: 50px;
  76. height: 50px;
  77. top: 10px;
  78. right: 10px;
  79. z-index: 1;
  80. }
  81. // Where all modal content resides
  82. .modal-body {
  83. position: relative;
  84. padding-bottom: 2em;
  85. header {
  86. padding-left: 2em;
  87. padding-right: 100px;
  88. &.tab-merged {
  89. padding-left: 1.6em;
  90. }
  91. }
  92. .header-title {
  93. // stylelint-disable-next-line declaration-no-important
  94. padding-left: 0 !important;
  95. margin-left: -36px;
  96. }
  97. .tab-merged .header-title {
  98. margin-left: 0;
  99. }
  100. }
  101. @include media-breakpoint-up(sm) {
  102. .modal-dialog {
  103. padding: 0 0 2em $menu-width;
  104. }
  105. .modal-body {
  106. header.tab-merged {
  107. padding-left: $desktop-nice-padding;
  108. }
  109. }
  110. }
  111. @include media-breakpoint-up(xl) {
  112. .modal-dialog {
  113. max-width: 100em;
  114. padding: 0 0 2em;
  115. }
  116. }