modal.scss 6.0 KB

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