modal.scss 6.8 KB

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