modal.scss 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282
  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. }
  71. // &-close {
  72. // position: absolute;
  73. // right: 15px;
  74. // }
  75. &-header {
  76. display: flex;
  77. align-items: flex-start;
  78. margin: $spacing-modal_header-marginY $spacing-modal_header-marginX;
  79. padding: $spacing-modal_header-paddingY $spacing-modal_header-paddingX;
  80. font-size: $font-modal_header-fontSize;
  81. font-weight: $font-modal_header-fontWeight;
  82. background-color: $color-modal_header-bg;
  83. color: $color-modal_main-text;
  84. border-bottom: $width-modal_header-border solid $color-modal_header-border;
  85. }
  86. &-body-wrapper {
  87. display: flex;
  88. align-items: flex-start;
  89. margin: $spacing-modal_body_wrapper-marginY $spacing-modal_body_wrapper-marginX;
  90. }
  91. &-body {
  92. flex: 1 1 auto;
  93. // padding: $spacing-loose;
  94. margin: $spacing-modal_body-margin;
  95. padding: $spacing-modal_body-padding;
  96. }
  97. &-withIcon {
  98. margin-left: $spacing-modal_content_withicon-marginLeft;
  99. }
  100. &-footer {
  101. // padding: $spacing-loose;
  102. margin: $spacing-modal_footer-marginY $spacing-modal_footer-marginX;
  103. padding: $spacing-modal_footer-paddingY $spacing-modal_footer-paddingX;
  104. text-align: right;
  105. border-radius: $radius-modal_footer;
  106. border-top: $width-modal_footer-border solid $color-modal_footer-border;
  107. background-color: $color-modal_footer-bg;
  108. .#{$prefix}-button {
  109. margin-left: $spacing-modal_footer_button-marginLeft;
  110. margin-right: 0;
  111. }
  112. }
  113. &-confirm {
  114. .#{$module}-header {
  115. margin-bottom: $spacing-modal_confirm_header-marginBottom;
  116. }
  117. // &-content-withIcon {
  118. // margin-left: 36px;
  119. // }
  120. &-icon-wrapper {
  121. display: inline-flex;
  122. margin-right: $spacing-modal_confirm_icon_wrapper-marginRight;
  123. width: $width-icon-extra-large;
  124. }
  125. &-icon {
  126. display: inline-flex;
  127. color: $color-modal_primary-icon;
  128. }
  129. }
  130. &-info-icon {
  131. color: $color-modal_info-icon;
  132. }
  133. &-success-icon {
  134. color: $color-modal_success-icon;
  135. }
  136. &-error-icon {
  137. color: $color-modal_danger-icon;
  138. }
  139. &-warning-icon {
  140. color: $color-modal_warning-icon;
  141. }
  142. &-small {
  143. width: $width-modal_small;
  144. }
  145. &-medium {
  146. width: $width-modal_medium;
  147. }
  148. &-large {
  149. width: $width-modal_large;
  150. }
  151. &-full-width {
  152. width: $width-modal_full_width;
  153. }
  154. }
  155. .#{$module}-centered {
  156. margin: 0 auto;
  157. }
  158. .#{$module}-popup {
  159. .#{$module}-mask,
  160. .#{$module}-wrap {
  161. position: absolute;
  162. overflow: hidden;
  163. }
  164. }
  165. .#{$module}-fixed {
  166. .#{$module}-mask,
  167. .#{$module}-wrap {
  168. position: fixed;
  169. overflow: hidden;
  170. }
  171. }
  172. .#{$module}-displayNone {
  173. display: none;
  174. }
  175. .#{$module}-content-animate-show {
  176. animation: $animation_duration-modal-show #{$module}-content-keyframe-show $animation_function-modal-show $animation_delay-modal-show forwards;
  177. animation-fill-mode: forwards;
  178. }
  179. .#{$module}-content-animate-hide {
  180. animation: $animation_duration-modal-hide #{$module}-content-keyframe-hide $animation_function-modal-hide $animation_delay-modal-hide forwards;
  181. animation-fill-mode: forwards;
  182. }
  183. .#{$module}-mask-animate-show {
  184. animation: $animation_duration-modal_mask-show #{$module}-mask-keyframe-show $animation_function-modal_mask-show $animation_delay-modal_mask-show forwards;
  185. animation-fill-mode: forwards;
  186. }
  187. .#{$module}-mask-animate-hide {
  188. animation: $animation_duration-modal_mask-hide #{$module}-mask-keyframe-hide $animation_function-modal_mask-hide $animation_delay-modal_mask-hide forwards;
  189. animation-fill-mode: forwards;
  190. }
  191. @keyframes #{$module}-content-keyframe-show {
  192. 0% {
  193. opacity: $animation_opacity-modal_content_open;
  194. transform: scale($animation_transform_scale-modal_content-open);
  195. }
  196. 100% {
  197. opacity: 1;
  198. transform: scale(1);
  199. }
  200. }
  201. @keyframes #{$module}-content-keyframe-hide {
  202. 0% {
  203. opacity: 1;
  204. transform: scale(1);
  205. }
  206. 100% {
  207. opacity: $animation_opacity-modal_content-close;
  208. transform: scale($animation_transform_scale-modal_content-close);
  209. }
  210. }
  211. @keyframes #{$module}-mask-keyframe-show {
  212. 0% {
  213. opacity: $animation_opacity-modal_mask-open;
  214. }
  215. 100% {
  216. opacity: 1;
  217. }
  218. }
  219. @keyframes #{$module}-mask-keyframe-hide {
  220. 0% {
  221. opacity: 1;
  222. }
  223. 100% {
  224. opacity: $animation_opacity-modal_mask-close;
  225. }
  226. }
  227. @import "./rtl.scss";