index.less 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. @import './var.less';
  2. :root {
  3. --van-step-text-color: @step-text-color;
  4. --van-step-active-color: @step-active-color;
  5. --van-step-process-text-color: @step-process-text-color;
  6. --van-step-font-size: @step-font-size;
  7. --van-step-line-color: @step-line-color;
  8. --van-step-finish-line-color: @step-finish-line-color;
  9. --van-step-finish-text-color: @step-finish-text-color;
  10. --van-step-icon-size: @step-icon-size;
  11. --van-step-circle-size: @step-circle-size;
  12. --van-step-circle-color: @step-circle-color;
  13. --van-step-horizontal-title-font-size: @step-horizontal-title-font-size;
  14. }
  15. .van-step {
  16. position: relative;
  17. flex: 1;
  18. color: var(--van-step-text-color);
  19. font-size: var(--van-step-font-size);
  20. &__circle {
  21. display: block;
  22. width: var(--van-step-circle-size);
  23. height: var(--van-step-circle-size);
  24. background-color: var(--van-step-circle-color);
  25. border-radius: 50%;
  26. }
  27. &__line {
  28. position: absolute;
  29. background-color: var(--van-step-line-color);
  30. transition: background-color var(--van-animation-duration-base);
  31. }
  32. &--horizontal {
  33. float: left;
  34. &:first-child {
  35. .van-step__title {
  36. margin-left: 0;
  37. transform: none;
  38. }
  39. }
  40. &:last-child {
  41. position: absolute;
  42. right: 1px;
  43. width: auto;
  44. .van-step__title {
  45. margin-left: 0;
  46. transform: none;
  47. }
  48. .van-step__circle-container {
  49. right: -9px;
  50. left: auto;
  51. }
  52. }
  53. .van-step__circle-container {
  54. position: absolute;
  55. top: 30px;
  56. left: calc(var(--van-padding-xs) * -1);
  57. z-index: 1;
  58. padding: 0 var(--van-padding-xs);
  59. background-color: var(--van-background-color-light);
  60. transform: translateY(-50%);
  61. }
  62. .van-step__title {
  63. display: inline-block;
  64. margin-left: 3px;
  65. font-size: var(--van-step-horizontal-title-font-size);
  66. transform: translateX(-50%);
  67. }
  68. .van-step__line {
  69. top: 30px;
  70. left: 0;
  71. width: 100%;
  72. height: 1px;
  73. }
  74. .van-step__icon {
  75. display: block;
  76. font-size: var(--van-step-icon-size);
  77. }
  78. .van-step--process {
  79. color: var(--van-step-process-text-color);
  80. }
  81. }
  82. &--vertical {
  83. display: block;
  84. float: none;
  85. padding: 10px 10px 10px 0;
  86. line-height: var(--van-line-height-sm);
  87. &:not(:last-child)::after {
  88. border-bottom-width: 1px;
  89. }
  90. .van-step__circle-container {
  91. position: absolute;
  92. top: 19px;
  93. left: -15px;
  94. z-index: 1;
  95. font-size: var(--van-step-icon-size);
  96. line-height: 1;
  97. transform: translate(-50%, -50%);
  98. }
  99. .van-step__line {
  100. top: 16px;
  101. left: -15px;
  102. width: 1px;
  103. height: 100%;
  104. }
  105. }
  106. &:last-child {
  107. .van-step__line {
  108. width: 0;
  109. }
  110. }
  111. &--finish {
  112. color: var(--van-step-finish-text-color);
  113. .van-step__circle,
  114. .van-step__line {
  115. background-color: var(--van-step-finish-line-color);
  116. }
  117. }
  118. &__icon,
  119. &__title {
  120. transition: color var(--van-animation-duration-base);
  121. &--active,
  122. &--finish {
  123. color: var(--van-step-active-color);
  124. }
  125. }
  126. }