index.less 2.5 KB

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