modal.scss 6.1 KB

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