_modal.scss 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. // Modals
  2. .modal {
  3. // Modal Header
  4. .modal-header {
  5. background-color: $body-bg;
  6. border-bottom: none;
  7. border-bottom-left-radius: 0;
  8. border-bottom-right-radius: 0;
  9. // close button
  10. .close {
  11. padding: 0.2rem 0.62rem;
  12. box-shadow: 0 5px 20px 0 rgba($black, 0.1);
  13. border-radius: $border-radius;
  14. background: $white;
  15. opacity: 1;
  16. transition: all 0.23s ease 0.1s;
  17. position: relative;
  18. transform: translate(8px, -2px);
  19. // For hover effect of close btn
  20. &:hover,
  21. &:focus,
  22. &:active {
  23. opacity: 1;
  24. outline: none;
  25. transform: translate(5px, 3px);
  26. box-shadow: none;
  27. }
  28. }
  29. }
  30. // Modal Content
  31. .modal-content {
  32. border: none;
  33. // overflow: unset; updated to "visible" as close icon is not visible in IE
  34. overflow: visible;
  35. box-shadow: 0 5px 20px 0 rgba($black, 0.1);
  36. }
  37. .modal-footer {
  38. padding: $modal-inner-padding;
  39. }
  40. // modal sticky for apps
  41. &.modal-sticky {
  42. bottom: 0;
  43. right: 0;
  44. top: auto;
  45. left: auto;
  46. height: auto;
  47. position: fixed;
  48. .modal-header {
  49. display: flex;
  50. align-items: center;
  51. justify-content: space-between;
  52. }
  53. .modal-dialog {
  54. margin-right: #{$content-padding} !important;
  55. box-shadow: 0px 0px 24px 0 rgba($black, 0.25);
  56. border-radius: $border-radius;
  57. }
  58. .modal-actions {
  59. background: transparent;
  60. box-shadow: none;
  61. line-height: 0;
  62. }
  63. }
  64. }
  65. // Modal XS
  66. .modal-xs {
  67. max-width: 300px;
  68. }
  69. // Modal XL
  70. @media (min-width: 1200px) {
  71. .modal-xl {
  72. margin-left: 3%;
  73. margin-right: 3%;
  74. }
  75. }
  76. // Slide In Modal //
  77. .modal-slide-in,
  78. .modal-slide-in .modal {
  79. padding: 0 !important;
  80. overflow: hidden !important;
  81. }
  82. .modal-slide-in {
  83. .modal-dialog {
  84. position: fixed;
  85. top: 0;
  86. right: 0;
  87. bottom: 0;
  88. left: auto;
  89. margin: 0;
  90. max-width: none;
  91. width: ($modal-slide-in-width-sm - 5);
  92. .modal-content {
  93. padding-bottom: ($modal-title-line-height * $close-font-size) + $modal-header-padding-y;
  94. padding-top: ($modal-title-line-height * $close-font-size) + $modal-header-padding-y;
  95. overflow: auto;
  96. border-radius: 0;
  97. height: 100%;
  98. }
  99. .modal-body {
  100. padding-bottom: 0;
  101. padding-top: 0;
  102. margin: auto 0;
  103. flex-grow: 0;
  104. }
  105. @media (min-width: (map-get($grid-breakpoints, sm))) {
  106. width: $modal-slide-in-width;
  107. }
  108. &.sidebar-sm {
  109. width: $modal-slide-in-width-sm;
  110. }
  111. &.sidebar-lg {
  112. @media (min-width: (map-get($grid-breakpoints, sm))) {
  113. width: $modal-slide-in-width-lg;
  114. }
  115. }
  116. }
  117. .close {
  118. top: $modal-header-padding-y / 2;
  119. z-index: 10;
  120. transform: none;
  121. position: absolute;
  122. top: 1.5rem;
  123. right: $modal-header-padding-x;
  124. margin: 0;
  125. padding: 0 !important;
  126. line-height: 0.5;
  127. transform: translate(0, -50%);
  128. }
  129. }
  130. // Slide from Right
  131. .modal-slide-in.fade .modal-dialog,
  132. .modal-slide-in .modal.fade .modal-dialog {
  133. transform: translateX(100%);
  134. transition: transform 0.1s ease-out;
  135. }
  136. .modal-slide-in.show .modal-dialog,
  137. .modal-slide-in .modal.show .modal-dialog {
  138. transform: translateX(0) !important;
  139. transition: transform 0.1s ease-out;
  140. }
  141. // To remove Max-width of XS Modal in Small Screen
  142. @media (max-width: 576px) {
  143. .modal {
  144. padding-right: 1rem;
  145. padding-left: 1rem;
  146. .modal-xs,
  147. .modal-sm {
  148. max-width: unset;
  149. }
  150. &.modal-sticky .modal-dialog {
  151. margin-right: 0.2rem !important;
  152. margin-left: 0.2rem;
  153. margin-bottom: 3rem;
  154. }
  155. }
  156. }