index-pure.less 4.1 KB

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