_modals.scss 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  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. outline: none;
  54. margin-top: 2em;
  55. padding-bottom: 3em;
  56. display: inline-block;
  57. vertical-align: middle;
  58. overflow: hidden;
  59. }
  60. // Modal background
  61. .modal-backdrop {
  62. position: fixed;
  63. top: 0;
  64. right: 0;
  65. bottom: 0;
  66. left: 0;
  67. z-index: ($zindex-modal-background - 10);
  68. background-color: $color-black;
  69. // Fade for backdrop
  70. &.fade { opacity: 0; }
  71. &.in { opacity: 0.5; }
  72. }
  73. .modal .close {
  74. padding: 0;
  75. position: absolute;
  76. width: 50px;
  77. height: 50px;
  78. top: 10px;
  79. right: 10px;
  80. z-index: 1;
  81. }
  82. // Where all modal content resides
  83. .modal-body {
  84. position: relative;
  85. padding-bottom: 2em;
  86. header {
  87. padding-left: 2em;
  88. padding-right: 100px;
  89. }
  90. .header-title {
  91. // stylelint-disable-next-line declaration-no-important
  92. padding-left: 0 !important;
  93. margin-left: -36px;
  94. }
  95. }
  96. @include media-breakpoint-up(sm) {
  97. .modal-dialog {
  98. padding: 0 0 2em $menu-width;
  99. }
  100. }
  101. @include media-breakpoint-up(xl) {
  102. .modal-dialog {
  103. max-width: 100em;
  104. padding: 0 0 2em;
  105. }
  106. }