index.less 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. @import '../../style/themes/index';
  2. @import '../../style/mixins/index';
  3. @timeline-prefix-cls: ~'@{ant-prefix}-timeline';
  4. .@{timeline-prefix-cls} {
  5. .reset-component();
  6. margin: 0;
  7. padding: 0;
  8. list-style: none;
  9. &-item {
  10. position: relative;
  11. margin: 0;
  12. padding-bottom: @timeline-item-padding-bottom;
  13. font-size: @font-size-base;
  14. list-style: none;
  15. &-tail {
  16. position: absolute;
  17. top: 10px;
  18. left: 4px;
  19. height: calc(100% - 10px);
  20. border-left: @timeline-width solid @timeline-color;
  21. }
  22. &-pending &-head {
  23. font-size: @font-size-sm;
  24. background-color: transparent;
  25. }
  26. &-pending &-tail {
  27. display: none;
  28. }
  29. &-head {
  30. position: absolute;
  31. width: 10px;
  32. height: 10px;
  33. background-color: @timeline-dot-bg;
  34. border: @timeline-dot-border-width solid transparent;
  35. border-radius: 100px;
  36. &-blue {
  37. color: @primary-color;
  38. border-color: @primary-color;
  39. }
  40. &-red {
  41. color: @error-color;
  42. border-color: @error-color;
  43. }
  44. &-green {
  45. color: @success-color;
  46. border-color: @success-color;
  47. }
  48. &-gray {
  49. color: @disabled-color;
  50. border-color: @disabled-color;
  51. }
  52. }
  53. &-head-custom {
  54. position: absolute;
  55. top: 5.5px;
  56. left: 5px;
  57. width: auto;
  58. height: auto;
  59. margin-top: 0;
  60. padding: 3px 1px;
  61. line-height: 1;
  62. text-align: center;
  63. border: 0;
  64. border-radius: 0;
  65. transform: translate(-50%, -50%);
  66. }
  67. &-content {
  68. position: relative;
  69. top: -(@font-size-base * @line-height-base - @font-size-base) + 1px;
  70. margin: 0 0 0 @margin-lg + 2px;
  71. word-break: break-word;
  72. }
  73. &-last {
  74. > .@{timeline-prefix-cls}-item-tail {
  75. display: none;
  76. }
  77. > .@{timeline-prefix-cls}-item-content {
  78. min-height: 48px;
  79. }
  80. }
  81. }
  82. &.@{timeline-prefix-cls}-alternate,
  83. &.@{timeline-prefix-cls}-right,
  84. &.@{timeline-prefix-cls}-label {
  85. .@{timeline-prefix-cls}-item {
  86. &-tail,
  87. &-head,
  88. &-head-custom {
  89. left: 50%;
  90. }
  91. &-head {
  92. margin-left: -4px;
  93. &-custom {
  94. margin-left: 1px;
  95. }
  96. }
  97. &-left {
  98. .@{timeline-prefix-cls}-item-content {
  99. left: calc(50% - 4px);
  100. width: calc(50% - 14px);
  101. text-align: left;
  102. }
  103. }
  104. &-right {
  105. .@{timeline-prefix-cls}-item-content {
  106. width: calc(50% - 12px);
  107. margin: 0;
  108. text-align: right;
  109. }
  110. }
  111. }
  112. }
  113. &.@{timeline-prefix-cls}-right {
  114. .@{timeline-prefix-cls}-item-right {
  115. .@{timeline-prefix-cls}-item-tail,
  116. .@{timeline-prefix-cls}-item-head,
  117. .@{timeline-prefix-cls}-item-head-custom {
  118. left: calc(100% - 4px - @timeline-width);
  119. }
  120. .@{timeline-prefix-cls}-item-content {
  121. width: calc(100% - 18px);
  122. }
  123. }
  124. }
  125. &&-pending &-item-last &-item-tail {
  126. display: block;
  127. height: calc(100% - 14px);
  128. border-left: 2px dotted @timeline-color;
  129. }
  130. &&-reverse &-item-last &-item-tail {
  131. display: none;
  132. }
  133. &&-reverse &-item-pending {
  134. .@{timeline-prefix-cls}-item-tail {
  135. top: 15px;
  136. display: block;
  137. height: calc(100% - 15px);
  138. border-left: 2px dotted @timeline-color;
  139. }
  140. .@{timeline-prefix-cls}-item-content {
  141. min-height: 48px;
  142. }
  143. }
  144. &.@{timeline-prefix-cls}-label {
  145. .@{timeline-prefix-cls}-item-label {
  146. position: absolute;
  147. top: -(@font-size-base * @line-height-base - @font-size-base) + 1px;
  148. width: calc(50% - 12px);
  149. text-align: right;
  150. }
  151. .@{timeline-prefix-cls}-item-right {
  152. .@{timeline-prefix-cls}-item-label {
  153. left: calc(50% + 14px);
  154. width: calc(50% - 14px);
  155. text-align: left;
  156. }
  157. }
  158. }
  159. }
  160. @import './rtl';