index.less 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263
  1. @notificationPrefixCls: rc-notification;
  2. .@{notificationPrefixCls} {
  3. // ====================== Notification ======================
  4. position: fixed;
  5. z-index: 1000;
  6. display: flex;
  7. max-height: 100vh;
  8. padding: 10px;
  9. align-items: flex-end;
  10. width: 340px;
  11. overflow-x: hidden;
  12. overflow-y: auto;
  13. height: 100vh;
  14. box-sizing: border-box;
  15. pointer-events: none;
  16. flex-direction: column;
  17. // Position
  18. &-top,
  19. &-topLeft,
  20. &-topRight {
  21. top: 0;
  22. }
  23. &-bottom,
  24. &-bottomRight,
  25. &-bottomLeft {
  26. bottom: 0;
  27. }
  28. &-bottomRight,
  29. &-topRight {
  30. right: 0;
  31. }
  32. // ========================= Notice =========================
  33. &-notice {
  34. position: relative;
  35. display: block;
  36. box-sizing: border-box;
  37. line-height: 1.5;
  38. width: 100%;
  39. &-wrapper {
  40. pointer-events: auto;
  41. position: relative;
  42. display: block;
  43. box-sizing: border-box;
  44. border-radius: 3px 3px;
  45. box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
  46. margin: 0 0 16px;
  47. border: 1px solid #999;
  48. border: 0px solid rgba(0, 0, 0, 0);
  49. background: #fff;
  50. width: 300px;
  51. }
  52. // Content
  53. &-content {
  54. padding: 7px 20px 7px 10px;
  55. }
  56. &-closable &-content {
  57. padding-right: 20px;
  58. }
  59. &-close {
  60. position: absolute;
  61. top: 3px;
  62. right: 5px;
  63. color: #000;
  64. font-weight: 700;
  65. font-size: 16px;
  66. line-height: 1;
  67. text-decoration: none;
  68. text-shadow: 0 1px 0 #fff;
  69. outline: none;
  70. cursor: pointer;
  71. opacity: 0.2;
  72. filter: alpha(opacity=20);
  73. &-x:after {
  74. content: '×';
  75. }
  76. &:hover {
  77. text-decoration: none;
  78. opacity: 1;
  79. filter: alpha(opacity=100);
  80. }
  81. }
  82. // Progress
  83. &-progress {
  84. position: absolute;
  85. left: 3px;
  86. right: 3px;
  87. border-radius: 1px;
  88. overflow: hidden;
  89. appearance: none;
  90. -webkit-appearance: none;
  91. display: block;
  92. inline-size: 100%;
  93. block-size: 2px;
  94. border: 0;
  95. &,
  96. &::-webkit-progress-bar {
  97. background-color: rgba(0, 0, 0, 0.04);
  98. }
  99. &::-moz-progress-bar {
  100. background-color: #31afff;
  101. }
  102. &::-webkit-progress-value {
  103. background-color: #31afff;
  104. }
  105. }
  106. }
  107. &-fade {
  108. overflow: hidden;
  109. transition: all 0.3s;
  110. }
  111. &-fade-appear-prepare {
  112. pointer-events: none;
  113. opacity: 0 !important;
  114. }
  115. &-fade-appear-start {
  116. transform: translateX(100%);
  117. opacity: 0;
  118. }
  119. &-fade-appear-active {
  120. transform: translateX(0);
  121. opacity: 1;
  122. }
  123. // .fade-effect() {
  124. // animation-duration: 0.3s;
  125. // animation-timing-function: cubic-bezier(0.55, 0, 0.55, 0.2);
  126. // animation-fill-mode: both;
  127. // }
  128. // &-fade-appear,
  129. // &-fade-enter {
  130. // opacity: 0;
  131. // animation-play-state: paused;
  132. // .fade-effect();
  133. // }
  134. // &-fade-leave {
  135. // .fade-effect();
  136. // animation-play-state: paused;
  137. // }
  138. // &-fade-appear&-fade-appear-active,
  139. // &-fade-enter&-fade-enter-active {
  140. // animation-name: rcNotificationFadeIn;
  141. // animation-play-state: running;
  142. // }
  143. // &-fade-leave&-fade-leave-active {
  144. // animation-name: rcDialogFadeOut;
  145. // animation-play-state: running;
  146. // }
  147. // @keyframes rcNotificationFadeIn {
  148. // 0% {
  149. // opacity: 0;
  150. // }
  151. // 100% {
  152. // opacity: 1;
  153. // }
  154. // }
  155. // @keyframes rcDialogFadeOut {
  156. // 0% {
  157. // opacity: 1;
  158. // }
  159. // 100% {
  160. // opacity: 0;
  161. // }
  162. // }
  163. // ========================= Stack =========================
  164. &-stack {
  165. & > .@{notificationPrefixCls}-notice {
  166. &-wrapper {
  167. transition: all 0.3s;
  168. position: absolute;
  169. top: 12px;
  170. opacity: 1;
  171. &:not(:nth-last-child(-n + 3)) {
  172. opacity: 0;
  173. right: 34px;
  174. width: 252px;
  175. overflow: hidden;
  176. color: transparent;
  177. pointer-events: none;
  178. }
  179. &:nth-last-child(1) {
  180. right: 10px;
  181. }
  182. &:nth-last-child(2) {
  183. right: 18px;
  184. width: 284px;
  185. color: transparent;
  186. overflow: hidden;
  187. }
  188. &:nth-last-child(3) {
  189. right: 26px;
  190. width: 268px;
  191. color: transparent;
  192. overflow: hidden;
  193. }
  194. }
  195. }
  196. &&-expanded {
  197. & > .@{notificationPrefixCls}-notice {
  198. &-wrapper {
  199. &:not(:nth-last-child(-n + 1)) {
  200. opacity: 1;
  201. width: 300px;
  202. right: 10px;
  203. overflow: unset;
  204. color: inherit;
  205. pointer-events: auto;
  206. }
  207. &::after {
  208. content: "";
  209. position: absolute;
  210. left: 0;
  211. right: 0;
  212. top: -16px;
  213. width: 100%;
  214. height: calc(100% + 32px);
  215. background: transparent;
  216. pointer-events: auto;
  217. color: rgb(0,0,0);
  218. }
  219. }
  220. }
  221. }
  222. &.@{notificationPrefixCls}-bottomRight {
  223. & > .@{notificationPrefixCls}-notice-wrapper {
  224. top: unset;
  225. bottom: 12px;
  226. }
  227. }
  228. }
  229. }