_modals.scss 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  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. inset-inline-end: 0;
  25. bottom: 0;
  26. inset-inline-start: 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-inline-start: auto;
  33. margin-inline-end: 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-inline-end: -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. inset-inline-end: 0;
  64. bottom: 0;
  65. inset-inline-start: 0;
  66. z-index: ($zindex-modal-background - 10);
  67. background-color: $color-black;
  68. // Fade for backdrop
  69. &.fade {
  70. opacity: 0;
  71. }
  72. &.in {
  73. opacity: 0.5;
  74. }
  75. }
  76. .modal .close {
  77. @apply w-bg-primary-200 hover:w-bg-black w-border-primary;
  78. padding: 0;
  79. position: absolute;
  80. width: 50px;
  81. height: 50px;
  82. top: 10px;
  83. inset-inline-end: 10px;
  84. z-index: 1;
  85. }
  86. // Where all modal content resides
  87. .modal-body {
  88. position: relative;
  89. padding-bottom: 2em;
  90. header {
  91. @apply w-bg-primary w-text-white;
  92. h1 {
  93. @apply w-text-white;
  94. font-weight: 700;
  95. font-size: 1.125rem;
  96. line-height: 130%;
  97. }
  98. }
  99. }
  100. @include media-breakpoint-up(sm) {
  101. .modal-dialog {
  102. padding: 0 0 2em $menu-width;
  103. }
  104. }
  105. @include media-breakpoint-up(xl) {
  106. .modal-dialog {
  107. max-width: 100em;
  108. padding: 0 0 2em;
  109. }
  110. }