modal.scss 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283
  1. //@import '../theme/variables.scss';
  2. @import "./animation.scss";
  3. @import "./variables.scss";
  4. $module: #{$prefix}-modal;
  5. .#{$module} {
  6. @include font-size-regular;
  7. position: relative;
  8. // width: 600px;
  9. margin: $spacing-modal-marginY $spacing-modal-marginX;
  10. color: $color-modal_main-text;
  11. &-mask {
  12. position: fixed;
  13. top: $spacing-modal_mask-top;
  14. right: $spacing-modal_mask-right;
  15. left: $spacing-modal_mask-left;
  16. bottom: $spacing-modal_mask-bottom;
  17. background-color: $color-modal_mask-bg;
  18. height: 100%;
  19. // filter: alpha(opacity=50);
  20. z-index: $z-modal-mask;
  21. &-hidden {
  22. display: none;
  23. }
  24. }
  25. &-icon-wrapper {
  26. display: inline-flex;
  27. margin-right: $spacing-modal_icon_wrapper-marginRight;
  28. width: $width-icon-extra-large;
  29. }
  30. &-wrap {
  31. position: fixed;
  32. overflow: auto;
  33. top: $spacing-modal_wrap-top;
  34. right: $spacing-modal_wrap-right;
  35. bottom: $spacing-modal_wrap-bottom;
  36. left: $spacing-modal_wrap-left;
  37. z-index: $z-modal;
  38. -webkit-overflow-scrolling: touch;
  39. outline: 0;
  40. &-center{
  41. display: flex;
  42. align-items: center;
  43. }
  44. }
  45. &-title {
  46. display: inline-flex;
  47. align-items: flex-start;
  48. justify-content: flex-start;
  49. width: $width-modal_title;
  50. margin: $spacing-modal_title-margin;
  51. }
  52. &-content {
  53. position: relative;
  54. display: flex;
  55. height: $height-modal_content;
  56. width: $width-modal_content;
  57. box-sizing: border-box;
  58. flex-direction: column;
  59. background-color: $color-modal-bg;
  60. border: $width-modal_content-border solid $color-modal_content-border;
  61. border-radius: $radius-modal_content;
  62. padding: $spacing-modal_content-paddingY $spacing-modal_content-paddingX;
  63. background-clip: padding-box;
  64. overflow: hidden;
  65. @include shadow-elevated;
  66. }
  67. &-content-fullScreen {
  68. border-radius: $radius-modal_content_fullscreen;
  69. border: none;
  70. top: $spacing-modal_content_fullscreen-top;
  71. }
  72. // &-close {
  73. // position: absolute;
  74. // right: 15px;
  75. // }
  76. &-header {
  77. display: flex;
  78. align-items: flex-start;
  79. margin: $spacing-modal_header-marginY $spacing-modal_header-marginX;
  80. padding: $spacing-modal_header-paddingY $spacing-modal_header-paddingX;
  81. font-size: $font-modal_header-fontSize;
  82. font-weight: $font-modal_header-fontWeight;
  83. background-color: $color-modal_header-bg;
  84. color: $color-modal_main-text;
  85. border-bottom: $width-modal_header-border solid $color-modal_header-border;
  86. }
  87. &-body-wrapper {
  88. display: flex;
  89. align-items: flex-start;
  90. margin: $spacing-modal_body_wrapper-marginY $spacing-modal_body_wrapper-marginX;
  91. }
  92. &-body {
  93. flex: 1 1 auto;
  94. // padding: $spacing-loose;
  95. margin: $spacing-modal_body-margin;
  96. padding: $spacing-modal_body-padding;
  97. }
  98. &-withIcon {
  99. margin-left: $spacing-modal_content_withicon-marginLeft;
  100. }
  101. &-footer {
  102. // padding: $spacing-loose;
  103. margin: $spacing-modal_footer-marginY $spacing-modal_footer-marginX;
  104. padding: $spacing-modal_footer-paddingY $spacing-modal_footer-paddingX;
  105. text-align: right;
  106. border-radius: $radius-modal_footer;
  107. border-top: $width-modal_footer-border solid $color-modal_footer-border;
  108. background-color: $color-modal_footer-bg;
  109. .#{$prefix}-button {
  110. margin-left: $spacing-modal_footer_button-marginLeft;
  111. margin-right: 0;
  112. }
  113. }
  114. &-confirm {
  115. .#{$module}-header {
  116. margin-bottom: $spacing-modal_confirm_header-marginBottom;
  117. }
  118. // &-content-withIcon {
  119. // margin-left: 36px;
  120. // }
  121. &-icon-wrapper {
  122. display: inline-flex;
  123. margin-right: $spacing-modal_confirm_icon_wrapper-marginRight;
  124. width: $width-icon-extra-large;
  125. }
  126. &-icon {
  127. display: inline-flex;
  128. color: $color-modal_primary-icon;
  129. }
  130. }
  131. &-info-icon {
  132. color: $color-modal_info-icon;
  133. }
  134. &-success-icon {
  135. color: $color-modal_success-icon;
  136. }
  137. &-error-icon {
  138. color: $color-modal_danger-icon;
  139. }
  140. &-warning-icon {
  141. color: $color-modal_warning-icon;
  142. }
  143. &-small {
  144. width: $width-modal_small;
  145. }
  146. &-medium {
  147. width: $width-modal_medium;
  148. }
  149. &-large {
  150. width: $width-modal_large;
  151. }
  152. &-full-width {
  153. width: $width-modal_full_width;
  154. }
  155. }
  156. .#{$module}-centered {
  157. margin: 0 auto;
  158. }
  159. .#{$module}-popup {
  160. .#{$module}-mask,
  161. .#{$module}-wrap {
  162. position: absolute;
  163. overflow: hidden;
  164. }
  165. }
  166. .#{$module}-fixed {
  167. .#{$module}-mask,
  168. .#{$module}-wrap {
  169. position: fixed;
  170. overflow: hidden;
  171. }
  172. }
  173. .#{$module}-displayNone {
  174. display: none;
  175. }
  176. .#{$module}-content-animate-show {
  177. animation: $animation_duration-modal-show #{$module}-content-keyframe-show $animation_function-modal-show $animation_delay-modal-show forwards;
  178. animation-fill-mode: forwards;
  179. }
  180. .#{$module}-content-animate-hide {
  181. animation: $animation_duration-modal-hide #{$module}-content-keyframe-hide $animation_function-modal-hide $animation_delay-modal-hide forwards;
  182. animation-fill-mode: forwards;
  183. }
  184. .#{$module}-mask-animate-show {
  185. animation: $animation_duration-modal_mask-show #{$module}-mask-keyframe-show $animation_function-modal_mask-show $animation_delay-modal_mask-show forwards;
  186. animation-fill-mode: forwards;
  187. }
  188. .#{$module}-mask-animate-hide {
  189. animation: $animation_duration-modal_mask-hide #{$module}-mask-keyframe-hide $animation_function-modal_mask-hide $animation_delay-modal_mask-hide forwards;
  190. animation-fill-mode: forwards;
  191. }
  192. @keyframes #{$module}-content-keyframe-show {
  193. 0% {
  194. opacity: $animation_opacity-modal_content_open;
  195. transform: scale($animation_transform_scale-modal_content-open);
  196. }
  197. 100% {
  198. opacity: 1;
  199. transform: scale(1);
  200. }
  201. }
  202. @keyframes #{$module}-content-keyframe-hide {
  203. 0% {
  204. opacity: 1;
  205. transform: scale(1);
  206. }
  207. 100% {
  208. opacity: $animation_opacity-modal_content-close;
  209. transform: scale($animation_transform_scale-modal_content-close);
  210. }
  211. }
  212. @keyframes #{$module}-mask-keyframe-show {
  213. 0% {
  214. opacity: $animation_opacity-modal_mask-open;
  215. }
  216. 100% {
  217. opacity: 1;
  218. }
  219. }
  220. @keyframes #{$module}-mask-keyframe-hide {
  221. 0% {
  222. opacity: 1;
  223. }
  224. 100% {
  225. opacity: $animation_opacity-modal_mask-close;
  226. }
  227. }
  228. @import "./rtl.scss";