index.less 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  1. @import '../../style/themes/index';
  2. @import '../../style/mixins/index';
  3. @spin-prefix-cls: ~'@{ant-prefix}-spin';
  4. @spin-dot-default: @text-color-secondary;
  5. .@{spin-prefix-cls} {
  6. .reset-component();
  7. position: absolute;
  8. display: none;
  9. color: @primary-color;
  10. font-size: 0;
  11. text-align: center;
  12. vertical-align: middle;
  13. opacity: 0;
  14. transition: transform 0.3s @ease-in-out-circ;
  15. &-spinning {
  16. position: static;
  17. display: inline-block;
  18. opacity: 1;
  19. }
  20. &-nested-loading {
  21. position: relative;
  22. > div > .@{spin-prefix-cls} {
  23. position: absolute;
  24. top: 0;
  25. left: 0;
  26. z-index: 4;
  27. display: block;
  28. width: 100%;
  29. height: 100%;
  30. max-height: 400px;
  31. .@{spin-prefix-cls}-dot {
  32. position: absolute;
  33. top: 50%;
  34. left: 50%;
  35. margin: -(@spin-dot-size / 2);
  36. }
  37. .@{spin-prefix-cls}-text {
  38. position: absolute;
  39. top: 50%;
  40. width: 100%;
  41. padding-top: ((@spin-dot-size - @font-size-base) / 2) + 2px;
  42. font-size: @font-size-base;
  43. text-shadow: 0 1px 2px @shadow-color-inverse;
  44. }
  45. &.@{spin-prefix-cls}-show-text .@{spin-prefix-cls}-dot {
  46. margin-top: -(@spin-dot-size / 2) - 10px;
  47. }
  48. }
  49. > div > .@{spin-prefix-cls}-sm {
  50. .@{spin-prefix-cls}-dot {
  51. margin: -(@spin-dot-size-sm / 2);
  52. }
  53. .@{spin-prefix-cls}-text {
  54. padding-top: ((@spin-dot-size-sm - @font-size-base) / 2) + 2px;
  55. }
  56. &.@{spin-prefix-cls}-show-text .@{spin-prefix-cls}-dot {
  57. margin-top: -(@spin-dot-size-sm / 2) - 10px;
  58. }
  59. }
  60. > div > .@{spin-prefix-cls}-lg {
  61. .@{spin-prefix-cls}-dot {
  62. margin: -(@spin-dot-size-lg / 2);
  63. }
  64. .@{spin-prefix-cls}-text {
  65. padding-top: ((@spin-dot-size-lg - @font-size-base) / 2) + 2px;
  66. }
  67. &.@{spin-prefix-cls}-show-text .@{spin-prefix-cls}-dot {
  68. margin-top: -(@spin-dot-size-lg / 2) - 10px;
  69. }
  70. }
  71. }
  72. &-container {
  73. position: relative;
  74. transition: opacity 0.3s;
  75. &::after {
  76. position: absolute;
  77. top: 0;
  78. right: 0;
  79. bottom: 0;
  80. left: 0;
  81. z-index: 10;
  82. display: ~'none \9';
  83. width: 100%;
  84. height: 100%;
  85. background: @component-background;
  86. opacity: 0;
  87. transition: all 0.3s;
  88. content: '';
  89. pointer-events: none;
  90. }
  91. }
  92. &-blur {
  93. clear: both;
  94. opacity: 0.5;
  95. user-select: none;
  96. pointer-events: none;
  97. &::after {
  98. opacity: 0.4;
  99. pointer-events: auto;
  100. }
  101. }
  102. // tip
  103. // ------------------------------
  104. &-tip {
  105. color: @spin-dot-default;
  106. }
  107. // dots
  108. // ------------------------------
  109. &-dot {
  110. position: relative;
  111. display: inline-block;
  112. font-size: @spin-dot-size;
  113. .square(1em);
  114. &-item {
  115. position: absolute;
  116. display: block;
  117. width: 9px;
  118. height: 9px;
  119. background-color: @primary-color;
  120. border-radius: 100%;
  121. transform: scale(0.75);
  122. transform-origin: 50% 50%;
  123. opacity: 0.3;
  124. animation: antSpinMove 1s infinite linear alternate;
  125. &:nth-child(1) {
  126. top: 0;
  127. left: 0;
  128. }
  129. &:nth-child(2) {
  130. top: 0;
  131. right: 0;
  132. animation-delay: 0.4s;
  133. }
  134. &:nth-child(3) {
  135. right: 0;
  136. bottom: 0;
  137. animation-delay: 0.8s;
  138. }
  139. &:nth-child(4) {
  140. bottom: 0;
  141. left: 0;
  142. animation-delay: 1.2s;
  143. }
  144. }
  145. &-spin {
  146. transform: rotate(0deg);
  147. animation: antRotate 1.2s infinite linear;
  148. }
  149. }
  150. // Sizes
  151. // ------------------------------
  152. // small
  153. &-sm &-dot {
  154. font-size: @spin-dot-size-sm;
  155. i {
  156. width: 6px;
  157. height: 6px;
  158. }
  159. }
  160. // large
  161. &-lg &-dot {
  162. font-size: @spin-dot-size-lg;
  163. i {
  164. width: 14px;
  165. height: 14px;
  166. }
  167. }
  168. &&-show-text &-text {
  169. display: block;
  170. }
  171. }
  172. @media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {
  173. /* IE10+ */
  174. .@{spin-prefix-cls}-blur {
  175. background: @component-background;
  176. opacity: 0.5;
  177. }
  178. }
  179. @keyframes antSpinMove {
  180. to {
  181. opacity: 1;
  182. }
  183. }
  184. @keyframes antRotate {
  185. to {
  186. transform: rotate(360deg);
  187. }
  188. }
  189. @import './rtl';