index.less 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255
  1. @import '../../style/themes/index';
  2. @import '../../style/mixins/index';
  3. @steps-prefix-cls: ~'@{ant-prefix}-steps';
  4. @process-icon-color: @primary-color;
  5. @process-title-color: @heading-color;
  6. @process-description-color: @text-color;
  7. @process-icon-text-color: @text-color-inverse;
  8. @wait-icon-color: @disabled-color;
  9. @wait-title-color: @text-color-secondary;
  10. @wait-description-color: @wait-title-color;
  11. @wait-tail-color: @process-tail-color;
  12. @finish-icon-color: @process-icon-color;
  13. @finish-title-color: @text-color;
  14. @finish-description-color: @text-color-secondary;
  15. @finish-tail-color: @primary-color;
  16. @error-icon-color: @error-color;
  17. @error-title-color: @error-color;
  18. @error-description-color: @error-color;
  19. @error-tail-color: @wait-tail-color;
  20. @steps-nav-active-color: @primary-color;
  21. .@{steps-prefix-cls} {
  22. .reset-component();
  23. display: flex;
  24. width: 100%;
  25. font-size: 0;
  26. text-align: initial;
  27. }
  28. .@{steps-prefix-cls}-item {
  29. position: relative;
  30. display: inline-block;
  31. flex: 1;
  32. overflow: hidden;
  33. vertical-align: top;
  34. &-container {
  35. outline: none;
  36. }
  37. &:last-child {
  38. flex: none;
  39. }
  40. &:last-child > &-container > &-tail,
  41. &:last-child > &-container > &-content > &-title::after {
  42. display: none;
  43. }
  44. &-icon,
  45. &-content {
  46. display: inline-block;
  47. vertical-align: top;
  48. }
  49. &-icon {
  50. width: @steps-icon-size;
  51. height: @steps-icon-size;
  52. margin: @steps-icon-margin;
  53. font-size: @steps-icon-font-size;
  54. font-family: @font-family;
  55. line-height: @steps-icon-size;
  56. text-align: center;
  57. border: @border-width-base @border-style-base @wait-icon-color;
  58. border-radius: @steps-icon-size;
  59. transition: background-color 0.3s, border-color 0.3s;
  60. .@{steps-prefix-cls}-icon {
  61. position: relative;
  62. top: @steps-icon-top;
  63. color: @primary-color;
  64. line-height: 1;
  65. }
  66. }
  67. &-tail {
  68. position: absolute;
  69. top: 12px;
  70. left: 0;
  71. width: 100%;
  72. padding: 0 10px;
  73. &::after {
  74. display: inline-block;
  75. width: 100%;
  76. height: 1px;
  77. background: @border-color-split;
  78. border-radius: 1px;
  79. transition: background 0.3s;
  80. content: '';
  81. }
  82. }
  83. &-title {
  84. position: relative;
  85. display: inline-block;
  86. padding-right: 16px;
  87. color: @text-color;
  88. font-size: @font-size-lg;
  89. line-height: @steps-title-line-height;
  90. &::after {
  91. position: absolute;
  92. top: (@steps-title-line-height / 2);
  93. left: 100%;
  94. display: block;
  95. width: 9999px;
  96. height: 1px;
  97. background: @wait-tail-color;
  98. content: '';
  99. }
  100. }
  101. &-subtitle {
  102. display: inline;
  103. margin-left: 8px;
  104. color: @text-color-secondary;
  105. font-weight: normal;
  106. font-size: @font-size-base;
  107. }
  108. &-description {
  109. color: @text-color-secondary;
  110. font-size: @font-size-base;
  111. }
  112. .step-item-status(wait);
  113. .step-item-status(process);
  114. &-process > &-container > &-icon {
  115. background: @process-icon-color;
  116. .@{steps-prefix-cls}-icon {
  117. color: @process-icon-text-color;
  118. }
  119. }
  120. &-process > &-container > &-title {
  121. font-weight: 500;
  122. }
  123. .step-item-status(finish);
  124. .step-item-status(error);
  125. &.@{steps-prefix-cls}-next-error .@{steps-prefix-cls}-item-title::after {
  126. background: @error-icon-color;
  127. }
  128. &-disabled {
  129. cursor: not-allowed;
  130. }
  131. }
  132. // ===================== Clickable =====================
  133. .@{steps-prefix-cls} .@{steps-prefix-cls}-item {
  134. &:not(.@{steps-prefix-cls}-item-active) {
  135. & > .@{steps-prefix-cls}-item-container[role='button'] {
  136. cursor: pointer;
  137. .@{steps-prefix-cls}-item {
  138. &-title,
  139. &-subtitle,
  140. &-description,
  141. &-icon .@{steps-prefix-cls}-icon {
  142. transition: color 0.3s;
  143. }
  144. }
  145. &:hover {
  146. .@{steps-prefix-cls}-item {
  147. &-title,
  148. &-subtitle,
  149. &-description {
  150. color: @primary-color;
  151. }
  152. }
  153. }
  154. }
  155. &:not(.@{steps-prefix-cls}-item-process) {
  156. & > .@{steps-prefix-cls}-item-container[role='button']:hover {
  157. .@{steps-prefix-cls}-item {
  158. &-icon {
  159. border-color: @primary-color;
  160. .@{steps-prefix-cls}-icon {
  161. color: @primary-color;
  162. }
  163. }
  164. }
  165. }
  166. }
  167. }
  168. }
  169. .@{steps-prefix-cls}-horizontal:not(.@{steps-prefix-cls}-label-vertical) {
  170. .@{steps-prefix-cls}-item {
  171. padding-left: 16px;
  172. white-space: nowrap;
  173. &:first-child {
  174. padding-left: 0;
  175. }
  176. &:last-child .@{steps-prefix-cls}-item-title {
  177. padding-right: 0;
  178. }
  179. &-tail {
  180. display: none;
  181. }
  182. &-description {
  183. max-width: @steps-description-max-width;
  184. white-space: normal;
  185. }
  186. }
  187. }
  188. .step-item-status(@status) {
  189. @icon-color: '@{status}-icon-color';
  190. @title-color: '@{status}-title-color';
  191. @description-color: '@{status}-description-color';
  192. @tail-color: '@{status}-tail-color';
  193. &-@{status} &-icon {
  194. background-color: @steps-background;
  195. border-color: @@icon-color;
  196. > .@{steps-prefix-cls}-icon {
  197. color: @@icon-color;
  198. .@{steps-prefix-cls}-icon-dot {
  199. background: @@icon-color;
  200. }
  201. }
  202. }
  203. &-@{status} > &-container > &-content > &-title {
  204. color: @@title-color;
  205. &::after {
  206. background-color: @@tail-color;
  207. }
  208. }
  209. &-@{status} > &-container > &-content > &-description {
  210. color: @@description-color;
  211. }
  212. &-@{status} > &-container > &-tail::after {
  213. background-color: @@tail-color;
  214. }
  215. }
  216. @import './custom-icon';
  217. @import './small';
  218. @import './vertical';
  219. @import './label-placement';
  220. @import './progress-dot';
  221. @import './nav';
  222. @import './rtl';
  223. @import './progress.less';