index.less 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. @import '../../style/themes/index';
  2. @import '../../style/mixins/index';
  3. @progress-prefix-cls: ~'@{ant-prefix}-progress';
  4. .@{progress-prefix-cls} {
  5. .reset-component();
  6. display: inline-block;
  7. &-line {
  8. position: relative;
  9. width: 100%;
  10. font-size: @font-size-base;
  11. }
  12. &-steps {
  13. display: inline-block;
  14. &-outer {
  15. display: flex;
  16. flex-direction: row;
  17. align-items: center;
  18. }
  19. &-item {
  20. flex-shrink: 0;
  21. min-width: 2px;
  22. margin-right: 2px;
  23. background: @progress-steps-item-bg;
  24. transition: all 0.3s;
  25. &-active {
  26. background: @progress-default-color;
  27. }
  28. }
  29. }
  30. &-small&-line,
  31. &-small&-line &-text .@{iconfont-css-prefix} {
  32. font-size: @font-size-sm;
  33. }
  34. &-outer {
  35. display: inline-block;
  36. width: 100%;
  37. margin-right: 0;
  38. padding-right: 0;
  39. .@{progress-prefix-cls}-show-info & {
  40. margin-right: ~'calc(-2em - 8px)';
  41. padding-right: ~'calc(2em + 8px)';
  42. }
  43. }
  44. &-inner {
  45. position: relative;
  46. display: inline-block;
  47. width: 100%;
  48. overflow: hidden;
  49. vertical-align: middle;
  50. background-color: @progress-remaining-color;
  51. border-radius: @progress-radius;
  52. }
  53. &-circle-trail {
  54. stroke: @progress-remaining-color;
  55. }
  56. &-circle-path {
  57. animation: ~'@{ant-prefix}-progress-appear' 0.3s;
  58. }
  59. &-inner:not(.@{ant-prefix}-progress-circle-gradient) {
  60. .@{ant-prefix}-progress-circle-path {
  61. stroke: @progress-default-color;
  62. }
  63. }
  64. &-success-bg,
  65. &-bg {
  66. position: relative;
  67. background-color: @progress-default-color;
  68. border-radius: @progress-radius;
  69. transition: all 0.4s @ease-out-circ 0s;
  70. }
  71. &-success-bg {
  72. position: absolute;
  73. top: 0;
  74. left: 0;
  75. background-color: @success-color;
  76. }
  77. &-text {
  78. display: inline-block;
  79. width: 2em;
  80. margin-left: 8px;
  81. color: @progress-info-text-color;
  82. font-size: @progress-text-font-size;
  83. line-height: 1;
  84. white-space: nowrap;
  85. text-align: left;
  86. vertical-align: middle;
  87. word-break: normal;
  88. .@{iconfont-css-prefix} {
  89. font-size: @font-size-base;
  90. }
  91. }
  92. &-status-active {
  93. .@{progress-prefix-cls}-bg::before {
  94. position: absolute;
  95. top: 0;
  96. right: 0;
  97. bottom: 0;
  98. left: 0;
  99. background: @component-background;
  100. border-radius: 10px;
  101. opacity: 0;
  102. animation: ~'@{ant-prefix}-progress-active' 2.4s @ease-out-quint infinite;
  103. content: '';
  104. }
  105. }
  106. &-status-exception {
  107. .@{progress-prefix-cls}-bg {
  108. background-color: @error-color;
  109. }
  110. .@{progress-prefix-cls}-text {
  111. color: @error-color;
  112. }
  113. }
  114. &-status-exception &-inner:not(.@{progress-prefix-cls}-circle-gradient) {
  115. .@{progress-prefix-cls}-circle-path {
  116. stroke: @error-color;
  117. }
  118. }
  119. &-status-success {
  120. .@{progress-prefix-cls}-bg {
  121. background-color: @success-color;
  122. }
  123. .@{progress-prefix-cls}-text {
  124. color: @success-color;
  125. }
  126. }
  127. &-status-success &-inner:not(.@{progress-prefix-cls}-circle-gradient) {
  128. .@{progress-prefix-cls}-circle-path {
  129. stroke: @success-color;
  130. }
  131. }
  132. &-circle &-inner {
  133. position: relative;
  134. line-height: 1;
  135. background-color: transparent;
  136. }
  137. &-circle &-text {
  138. position: absolute;
  139. top: 50%;
  140. left: 50%;
  141. width: 100%;
  142. margin: 0;
  143. padding: 0;
  144. color: @progress-text-color;
  145. font-size: @progress-circle-text-font-size;
  146. line-height: 1;
  147. white-space: normal;
  148. text-align: center;
  149. transform: translate(-50%, -50%);
  150. .@{iconfont-css-prefix} {
  151. font-size: (14 / 12em);
  152. }
  153. }
  154. &-circle&-status-exception {
  155. .@{progress-prefix-cls}-text {
  156. color: @error-color;
  157. }
  158. }
  159. &-circle&-status-success {
  160. .@{progress-prefix-cls}-text {
  161. color: @success-color;
  162. }
  163. }
  164. }
  165. @keyframes ~"@{ant-prefix}-progress-active" {
  166. 0% {
  167. transform: translateX(-100%) scaleX(0);
  168. opacity: 0.1;
  169. }
  170. 20% {
  171. transform: translateX(-100%) scaleX(0);
  172. opacity: 0.5;
  173. }
  174. 100% {
  175. transform: translateX(0) scaleX(1);
  176. opacity: 0;
  177. }
  178. }
  179. @import './rtl';