_modals.scss 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287
  1. // Modals
  2. // Styles for body
  3. body {
  4. &.modal-open {
  5. overflow: auto;
  6. padding-right: 0 !important;
  7. }
  8. &.scrollable {
  9. overflow-y: auto;
  10. }
  11. }
  12. // *** ENHANCED BOOTSTRAP MODALS ***///
  13. // General styles
  14. .modal-dialog {
  15. .modal-content {
  16. box-shadow: $z-depth-1-half;
  17. border: 0;
  18. border-radius: $border-radius-base;
  19. .modal-header {
  20. border-top-left-radius: $border-radius-base;
  21. border-top-right-radius: $border-radius-base;
  22. }
  23. }
  24. // Cascading modals
  25. &.cascading-modal {
  26. margin-top: 10%;
  27. .close {
  28. opacity: 1;
  29. text-shadow: none;
  30. color: $white-base;
  31. outline: 0;
  32. }
  33. // Cascading header
  34. .modal-header {
  35. box-shadow: $z-depth-1-half;
  36. margin: $cascading-modal-margin-top $cascading-modal-margin-right $cascading-modal-margin-bottom $cascading-modal-margin-left;
  37. border: none;
  38. border-radius: $border-radius-base;
  39. padding: $cascading-modal-padding;
  40. text-align: center;
  41. .close {
  42. margin-right: $cascading-modal-close-margin-right;
  43. }
  44. .title {
  45. margin-bottom: 0;
  46. width: 100%;
  47. font-size: $cascading-modal-font-size;
  48. .fas, .fab, .far {
  49. margin-right: $cascading-modal-fa-margin-right;
  50. }
  51. }
  52. .social-buttons {
  53. margin-top: $cascading-modal-social-margin-top;
  54. a {
  55. font-size: $cascading-modal-a-font-size;
  56. }
  57. }
  58. }
  59. // Cascading tabs nav
  60. .modal-c-tabs {
  61. .md-tabs {
  62. box-shadow: $z-depth-1;
  63. margin: $cascading-modal-tabs-margin-top $cascading-modal-tabs-margin-x 0 $cascading-modal-tabs-margin-x;
  64. display: flex;
  65. li {
  66. flex: 1;
  67. a {
  68. text-align: center;
  69. }
  70. }
  71. }
  72. .tab-content {
  73. padding: $cascading-modal-tabs-padding-top 0 0 0;
  74. }
  75. //.md-tabs {
  76. // border-radius: $md-card-border-radius;
  77. // .nav-item {
  78. // .nav-link {
  79. // border-radius: $md-card-border-radius;
  80. // background-color: inherit;
  81. // color: $white-base;
  82. // }
  83. // }
  84. //}
  85. }
  86. // Footer customization
  87. .modal-body,
  88. .modal-footer {
  89. padding-left: $modal-body-padding-left;
  90. padding-right: $modal-body-padding-right;
  91. color: $grey-darken-2;
  92. .additional-option {
  93. margin-top: $modal-body-margin-top;
  94. text-align: center;
  95. }
  96. }
  97. // Cascading avatar
  98. &.modal-avatar {
  99. margin-top: $modal-avatar-margin-top;
  100. .modal-header {
  101. box-shadow: none;
  102. @extend .img-fluid;
  103. margin: $modal-avatar-header-margin-top 0 $modal-avatar-header-margin-bottom;
  104. img {
  105. width: $modal-avatar-img-width;
  106. box-shadow: $z-depth-2;
  107. margin-left: auto;
  108. margin-right: auto;
  109. }
  110. }
  111. }
  112. }
  113. // Modal notify
  114. &.modal-notify {
  115. .heading {
  116. margin: 0;
  117. padding: $modal-notify-heading-padding;
  118. font-size: $modal-notify-font-size;
  119. color: $white-base;
  120. }
  121. .modal-header {
  122. box-shadow: $z-depth-1;
  123. border: 0;
  124. }
  125. .close {
  126. opacity: 1;
  127. }
  128. .modal-body {
  129. padding: $modal-notify-body-padding;
  130. color: $grey-darken-2;
  131. }
  132. @each $name, $color in $basic {
  133. &.modal-#{$name} {
  134. .modal-header {
  135. background-color: $color;
  136. }
  137. .fas, .fab, .far {
  138. color: $color;
  139. }
  140. .badge {
  141. background-color: $color;
  142. }
  143. .btn {
  144. .fas, .fab, .far {
  145. color: #fff;
  146. }
  147. &.btn-outline-#{$name} {
  148. .fas, .fab, .far {
  149. color: $color;
  150. }
  151. }
  152. }
  153. }
  154. }
  155. }
  156. }
  157. // Position & Size
  158. .modal {
  159. padding-right: 0 !important;
  160. .modal-dialog {
  161. @media (min-width: 768px) {
  162. &.modal-top {
  163. top: 0;
  164. }
  165. &.modal-left {
  166. left: 0;
  167. }
  168. &.modal-right {
  169. right: 0;
  170. }
  171. &.modal-bottom {
  172. bottom: 0;
  173. }
  174. &.modal-top-left {
  175. top: $modal-distance;
  176. left: $modal-distance;
  177. }
  178. &.modal-top-right {
  179. top: $modal-distance;
  180. right: $modal-distance;
  181. }
  182. &.modal-bottom-left {
  183. bottom: $modal-distance;
  184. left: $modal-distance;
  185. }
  186. &.modal-bottom-right {
  187. bottom: $modal-distance;
  188. right: $modal-distance;
  189. }
  190. }
  191. }
  192. &.fade {
  193. &.top:not(.show) .modal-dialog {
  194. transform: $modal-fade-top-transform;
  195. }
  196. &.left:not(.show) .modal-dialog {
  197. transform: $modal-fade-left-transform;
  198. }
  199. &.right:not(.show) .modal-dialog {
  200. transform: $modal-fade-right-transform;
  201. }
  202. &.bottom:not(.show) .modal-dialog {
  203. transform: $modal-fade-bottom-transform;
  204. }
  205. }
  206. @media (min-width: $medium-screen) {
  207. &.modal-scrolling {
  208. position: relative;
  209. .modal-dialog {
  210. position: fixed;
  211. z-index: 1050;
  212. }
  213. }
  214. &.modal-content-clickable {
  215. top: auto;
  216. bottom: auto;
  217. .modal-dialog {
  218. position: fixed;
  219. }
  220. }
  221. .modal-fluid {
  222. width: 100%;
  223. max-width: 100%;
  224. .modal-content {
  225. width: 100%;
  226. }
  227. }
  228. .modal-frame {
  229. position: absolute;
  230. margin: 0;
  231. width: 100%;
  232. max-width: 100%;
  233. &.modal-bottom {
  234. bottom: 0;
  235. }
  236. }
  237. .modal-full-height {
  238. position: absolute;
  239. display: flex;
  240. margin: 0;
  241. width: $modal-width;
  242. min-height: 100%;
  243. height: auto;
  244. min-height: 100%;
  245. top: 0;
  246. right: 0;
  247. &.modal-top,
  248. &.modal-bottom {
  249. display: block;
  250. width: 100%;
  251. max-width: 100%;
  252. height: auto;
  253. }
  254. &.modal-top {
  255. bottom: auto;
  256. }
  257. &.modal-bottom {
  258. min-height: 0;
  259. top: auto;
  260. }
  261. .modal-content {
  262. width: 100%;
  263. }
  264. &.modal-lg {
  265. width: 90%;
  266. max-width: 90%;
  267. @media (min-width: $medium-screen) {
  268. width: $modal-full-height-medium-screen;
  269. max-width: $modal-full-height-medium-screen;
  270. }
  271. @media (min-width: $large-screen) {
  272. width: $modal-full-height-large-screen;
  273. max-width: $modal-full-height-large-screen;
  274. }
  275. }
  276. }
  277. .modal-side {
  278. position: absolute;
  279. bottom: $modal-distance;
  280. right: $modal-distance;
  281. margin: 0;
  282. width: $modal-width;
  283. }
  284. }
  285. }