_timeline.scss 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. //
  2. // Timeline
  3. //
  4. .timeline {
  5. position: relative;
  6. // Axis
  7. &:before {
  8. content: '';
  9. position: absolute;
  10. top: 0;
  11. left: $timeline-left;
  12. height: 100%;
  13. border-right: $timeline-axis-width solid $timeline-axis-color;
  14. }
  15. }
  16. // Timeline blocks
  17. .timeline-block {
  18. position: relative;
  19. &:after {
  20. content: "";
  21. display: table;
  22. clear: both;
  23. }
  24. &:first-child {
  25. margin-top: 0;
  26. }
  27. &:last-child {
  28. margin-bottom: 0;
  29. }
  30. }
  31. // Timeline steps
  32. .timeline-step {
  33. position: absolute;
  34. display: inline-flex;
  35. align-items: center;
  36. justify-content: center;
  37. left: 0;
  38. width: $timeline-step-width;
  39. height: $timeline-step-height;
  40. border-radius: $timeline-step-radius;
  41. background: $timeline-step-bg;
  42. // border: $timeline-step-border-width solid $timeline-step-border-color;
  43. text-align: center;
  44. transform: $timeline-step-transform;
  45. font-size: $font-size-base;
  46. font-weight: $font-weight-bold;
  47. z-index: 1;
  48. svg, i {
  49. line-height: $timeline-step-line-height;
  50. }
  51. }
  52. // Timeline content and body
  53. .timeline-content {
  54. position: relative;
  55. margin-left: $timeline-content-margin-left;
  56. padding-top: $timeline-content-padding-top;
  57. position: relative;
  58. top: $timeline-content-top;
  59. &:after {
  60. content: "";
  61. display: table;
  62. clear: both;
  63. }
  64. }
  65. @include media-breakpoint-up(lg) {
  66. .timeline {
  67. &:before {
  68. left: 50%;
  69. margin-left: -1px;
  70. }
  71. }
  72. .timeline-step {
  73. left: 50%;
  74. }
  75. .timeline-content {
  76. width: 38%;
  77. }
  78. .timeline-block:nth-child(even) .timeline-content {
  79. float: right;
  80. }
  81. }
  82. // One side timeline
  83. .timeline-one-side {
  84. &:before {
  85. left: $timeline-left;
  86. }
  87. .timeline-step {
  88. left: $timeline-left;
  89. }
  90. .timeline-content {
  91. width: auto;
  92. }
  93. @include media-breakpoint-up(lg) {
  94. .timeline-content {
  95. max-width: 30rem;
  96. }
  97. }
  98. }
  99. .timeline-one-side .timeline-block:nth-child(even) .timeline-content {
  100. float: none;
  101. }