_modals.scss 6.4 KB

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