modal.scss 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303
  1. @import "vars";
  2. @import "mixins";
  3. //
  4. // Modals
  5. // --------------------------------------------------
  6. // .modal-open - body class for killing the scroll
  7. // .modal - container to scroll within
  8. // .modal-dialog - positioning shell for the actual modal
  9. // .modal-content - actual modal w/ bg and corners etc
  10. // Kill the scroll on the body
  11. .modal-open {overflow: hidden; }
  12. .modal-prev,
  13. .modal-next {
  14. color: $dark !important;
  15. position: fixed;
  16. top: 50%;
  17. margin: 0 34px;
  18. margin-top: -30px;
  19. opacity: 0.5;
  20. z-index: 2000;
  21. }
  22. .modal-prev { left: 0;}
  23. .modal-next { right: 0;}
  24. // Container that the modal scrolls within
  25. .modal {
  26. overflow: auto;
  27. overflow-y: scroll;
  28. position: fixed;
  29. top: 0;
  30. right: 0;
  31. bottom: 0;
  32. left: 0;
  33. z-index: 35000;
  34. -webkit-overflow-scrolling: touch;
  35. // Prevent Chrome on Windows from adding a focus outline. For details, see
  36. // https://github.com/twbs/bootstrap/pull/10951.
  37. outline: 0;
  38. // When fading in the modal, animate it to slide down
  39. &.fade .modal-dialog {
  40. // @include translate(0, -25%);
  41. @include transition-transform(0.1s ease-out);
  42. @include scale(0.98,0.98);
  43. }
  44. &.in {
  45. pointer-events: auto;
  46. .modal-dialog {
  47. // @include translate(0, 0)
  48. @include scale(1,1);
  49. }
  50. }
  51. .close {
  52. position: fixed;
  53. margin: 44px 44px;
  54. .icon {display: block; }
  55. }
  56. figure {
  57. margin: 0;
  58. img {
  59. display: block;
  60. margin: auto;
  61. }
  62. }
  63. }
  64. // Shell div to position the modal with bottom padding
  65. .modal-wrapper {
  66. position: relative;
  67. margin: 0px;
  68. display: table;
  69. height: 100%;
  70. width: 100%;
  71. background-color: rgba(0,0,0, 0.7);
  72. }
  73. .modal-appendix {
  74. position: relative;
  75. margin: 0px;
  76. display: table;
  77. width: 100%;
  78. text-align: center;
  79. background-color: $light;
  80. color: $medium;
  81. vertical-align: top;
  82. height: auto;
  83. .modal-section {
  84. max-width: 600px;
  85. margin: auto;
  86. text-align: left;
  87. }
  88. }
  89. .modal-dialog {
  90. position: relative;
  91. width: auto;
  92. margin: 0px;
  93. display: table-cell;
  94. vertical-align: middle;
  95. height: 100%;
  96. width: 100%;
  97. margin: auto;
  98. text-align: center;
  99. padding: 40px;
  100. &.top {vertical-align: top; }
  101. }
  102. .modal-medium {
  103. max-height: 100%;
  104. > * {
  105. max-width: 100%;
  106. max-height: 100%;
  107. }
  108. }
  109. // Actual modal
  110. .modal-content {
  111. width: 600px;
  112. position: relative;
  113. // @include box-shadow(0 0px 10px 5px rgba(0,0,0,0.05));
  114. background-clip: padding-box;
  115. // Remove focus outline from opened modal
  116. outline: none;
  117. display: inline-block;
  118. text-align: left;
  119. @include user-select(none);
  120. border-radius: $radius*3;
  121. background-color: $light !important;
  122. box-shadow: 0 0 1px 1px rgba(0, 0, 0, 0.05), 0 2px 7px rgba(0, 0, 0, 0.1);
  123. }
  124. .modal-header {
  125. padding: 30px 40px;
  126. position: relative;
  127. color: $medium;
  128. }
  129. .close-search {
  130. position: fixed;
  131. top: 0;
  132. right: 0;
  133. margin: 40px 35px;
  134. }
  135. // Title text within header
  136. .modal-title {
  137. color: $dark;
  138. font-size: 12px;
  139. text-transform: uppercase;
  140. letter-spacing: 0.2em;
  141. text-indent: 4px;
  142. text-align: center;
  143. padding-top: 30px;
  144. }
  145. .modal-side-tabs {
  146. position: absolute;
  147. right: 0;
  148. top: 0;
  149. list-style: none;
  150. padding: 0;
  151. height: 100%;
  152. padding: 15px;
  153. border-left: 2px solid rgba(0,0,0,0.025);
  154. z-index: 100;
  155. border-top-right-radius: $radius*3;
  156. border-bottom-right-radius: $radius*3;
  157. }
  158. .modal-tabs-wrapper {
  159. overflow: hidden;
  160. border-top-left-radius: $radius*3;
  161. border-top-right-radius: $radius*3;
  162. }
  163. .modal-tabs {
  164. display: table;
  165. width: 100%;
  166. table-layout: auto;
  167. background-color: $lightish;
  168. .dialog-tab {
  169. display: table-cell;
  170. text-align: center;
  171. &:hover span {color: $dark; }
  172. &.open span {
  173. background-color: $light;
  174. color: $dark;
  175. opacity: 1;
  176. box-shadow: 0 0 1px 1px rgba(0, 0, 0, 0.05), 0 2px 7px rgba(0, 0, 0, 0.1) !important;
  177. border-bottom-right-radius: 0px !important;
  178. border-bottom-left-radius: 0px !important;
  179. border-top-left-radius: $radius*3;
  180. border-top-right-radius: $radius*3;
  181. }
  182. &:first-child span {
  183. box-shadow: inset 0px -4px 1px -4px rgba(0, 0, 0, 0.05), inset 0px -4px 7px -4px rgba(0, 0, 0, 0.1);
  184. // border-top-left-radius: $radius*3;
  185. // border-bottom-right-radius: $radius*3;
  186. }
  187. &:last-child span {
  188. // box-shadow: inset 0 -4px 1px -4px rgba(0, 0, 0, 0.05), inset 0 -4px 7px -4px rgba(0, 0, 0, 0.1);
  189. // border-top-right-radius: $radius*3;
  190. // border-bottom-left-radius: $radius*3;
  191. }
  192. span {
  193. box-shadow: inset 0 -4px 1px -4px rgba(0, 0, 0, 0.05), inset 0 -4px 7px -4px rgba(0, 0, 0, 0.1);
  194. cursor: pointer;
  195. font-size: 12px;
  196. text-transform: uppercase;
  197. letter-spacing: 0.2em;
  198. text-indent: 4px;
  199. display: block;
  200. width: 100%;
  201. height: 44px;
  202. line-height: 44px;
  203. }
  204. }
  205. }
  206. // Modal body
  207. // Where all modal content resides (sibling of .modal-header and .modal-footer)
  208. .modal-body {
  209. position: relative;
  210. @include clearfix();
  211. }
  212. .modal {
  213. .modal-section {
  214. // overflow: hidden;
  215. border-bottom: 2px solid rgba(0,0,0,0.04);
  216. padding: 40px;
  217. display: block;
  218. @include clearfix();
  219. &:first-child {
  220. border-top-left-radius: $radius*3 !important;
  221. border-top-right-radius: $radius*3 !important;
  222. }
  223. &.dark {background-color: $dark; }
  224. &.light {background-color: $light; }
  225. .modal-section-title {
  226. margin: 0;
  227. padding-top: 15px;
  228. color: $dark;
  229. font-size: 12px;
  230. text-transform: uppercase;
  231. letter-spacing: 0.2em;
  232. text-indent: 4px;
  233. text-align: center;
  234. }
  235. }
  236. }
  237. // Footer (for actions)
  238. .modal-footer {
  239. // border-bottom-left-radius: $radius;
  240. // border-bottom-right-radius: $radius;
  241. // background-color: $dark !important;
  242. // padding: 40px;
  243. // padding-top: 0px;
  244. // text-align: right; // right align buttons
  245. @include clearfix(); // clear it in case folks use .pull-* classes on buttons
  246. // Properly space out buttons
  247. // .btn + .btn {
  248. // margin-left: 5px;
  249. // margin-bottom: 0; // account for input[type="submit"] which gets the bottom margin like all other inputs
  250. // }
  251. // // but override that for button groups
  252. // .btn-group .btn + .btn {
  253. // margin-left: -1px;
  254. // }
  255. // // and override it for block buttons as well
  256. // .btn-block + .btn-block {
  257. // margin-left: 0;
  258. // }
  259. }