timeline-item.scss 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. @use 'mixins/mixins' as *;
  2. @use 'common/var' as *;
  3. @mixin alternate-tail-node-center {
  4. @include e((tail, node)) {
  5. left: 50%;
  6. transform: translateX(-50%);
  7. }
  8. }
  9. @include b(timeline-item) {
  10. position: relative;
  11. padding-bottom: 20px;
  12. @include e(wrapper) {
  13. box-sizing: content-box;
  14. position: relative;
  15. top: -3px;
  16. }
  17. @include e(tail) {
  18. position: absolute;
  19. height: 100%;
  20. border-left: 2px solid getCssVar('timeline-node-color');
  21. }
  22. & .#{$namespace}-timeline-item__icon {
  23. color: getCssVar('color-white');
  24. font-size: getCssVar('font-size-small');
  25. }
  26. @include e(node) {
  27. position: absolute;
  28. background-color: getCssVar('timeline-node-color');
  29. border-color: getCssVar('timeline-node-color');
  30. border-radius: 50%;
  31. box-sizing: border-box;
  32. display: flex;
  33. justify-content: center;
  34. align-items: center;
  35. @include m(normal) {
  36. width: getCssVar('timeline-node-size-normal');
  37. height: getCssVar('timeline-node-size-normal');
  38. }
  39. @include m(large) {
  40. width: getCssVar('timeline-node-size-large');
  41. height: getCssVar('timeline-node-size-large');
  42. }
  43. @include when(hollow) {
  44. background: getCssVar('color-white');
  45. border-style: solid;
  46. border-width: 2px;
  47. }
  48. @each $type in (primary, success, warning, danger, info) {
  49. @include m($type) {
  50. background-color: getCssVar('color', $type);
  51. border-color: getCssVar('color', $type);
  52. }
  53. }
  54. }
  55. @include e(dot) {
  56. position: absolute;
  57. display: flex;
  58. justify-content: center;
  59. align-items: center;
  60. }
  61. @include e(content) {
  62. color: getCssVar('text-color', 'primary');
  63. }
  64. @include e(timestamp) {
  65. color: getCssVar('text-color', 'secondary');
  66. line-height: 1;
  67. font-size: getCssVar('font-size-small');
  68. @include when(top) {
  69. margin-bottom: 8px;
  70. padding-top: 4px;
  71. }
  72. @include when(bottom) {
  73. margin-top: 8px;
  74. }
  75. }
  76. @include when(start) {
  77. @include e(wrapper) {
  78. padding-left: 28px;
  79. }
  80. @include e(tail) {
  81. left: 4px;
  82. }
  83. @include e(node) {
  84. @include m(normal) {
  85. left: -1px;
  86. }
  87. @include m(large) {
  88. left: -2px;
  89. }
  90. }
  91. }
  92. @include when(end) {
  93. @include e(wrapper) {
  94. padding-right: 28px;
  95. text-align: right;
  96. }
  97. @include e(tail) {
  98. right: 4px;
  99. }
  100. @include e(node) {
  101. @include m(normal) {
  102. right: -1px;
  103. }
  104. @include m(large) {
  105. right: -2px;
  106. }
  107. }
  108. }
  109. @include when(alternate) {
  110. @include alternate-tail-node-center;
  111. }
  112. @include when(alternate-reverse) {
  113. @include alternate-tail-node-center;
  114. }
  115. }