Нема описа
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

_timeline.scss 6.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  1. /* Timeline
  2. ******************************************************************************* */
  3. .timeline {
  4. --#{$prefix}timeline-point-indicator-color: #{$timeline-point-indicator-color};
  5. --#{$prefix}timeline-event-time-color: #{$timeline-event-time-color};
  6. position: relative;
  7. padding: 0;
  8. block-size: 100%;
  9. inline-size: 100%;
  10. list-style: none;
  11. &:not(.timeline-center) {
  12. padding-inline-start: .5rem;
  13. }
  14. .timeline-header {
  15. display: flex;
  16. flex-direction: row;
  17. align-items: center;
  18. justify-content: space-between;
  19. > *:first-child {
  20. margin-inline-end: .5rem;
  21. }
  22. }
  23. // Timeline Item
  24. .timeline-item {
  25. position: relative;
  26. border: 0;
  27. border-inline-start: 1px solid $timeline-border-color;
  28. padding-inline-start: 1.4rem;
  29. .timeline-event {
  30. position: relative;
  31. @include border-radius($timeline-item-border-radius);
  32. background-color: $timeline-item-bg-color;
  33. inline-size: 100%;
  34. min-block-size: $timeline-item-min-height;
  35. padding-block: $timeline-item-padding-y $timeline-item-padding-y - .1625;
  36. padding-inline: $timeline-item-padding-x;
  37. .timeline-event-time {
  38. position: absolute;
  39. color: var(--#{$prefix}timeline-event-time-color);
  40. font-size: $timeline-event-time-size;
  41. inset-block-start: 1.2rem;
  42. }
  43. }
  44. // Timeline Point Indicator
  45. .timeline-indicator,
  46. .timeline-indicator-advanced {
  47. position: absolute;
  48. z-index: 2;
  49. display: flex;
  50. align-items: center;
  51. justify-content: center;
  52. @include border-radius(50%);
  53. background-color: var(--#{$prefix}body-bg);
  54. block-size: $timeline-indicator-size;
  55. box-shadow: 0 0 0 10px var(--#{$prefix}body-bg);
  56. inline-size: $timeline-indicator-size;
  57. inset-block-start: .64rem;
  58. inset-inline-start: -1rem;
  59. text-align: center;
  60. // Icons
  61. .icon-base {
  62. color: var(--#{$prefix}timeline-point-indicator-color);
  63. }
  64. }
  65. // Timeline Indicator
  66. & [class*="timeline-indicator-"] {
  67. background-color: var(--#{$prefix}timeline-point-indicator-bg);
  68. }
  69. // For advanced Timeline Indicator Background
  70. .timeline-indicator-advanced {
  71. background-color: var(--#{$prefix}paper-bg);
  72. box-shadow: 0 0 0 10px var(--#{$prefix}paper-bg);
  73. inset-block-start: 0;
  74. }
  75. .timeline-point {
  76. position: absolute;
  77. z-index: 2;
  78. display: block;
  79. @include border-radius(50%);
  80. background-color: var(--#{$prefix}timeline-point-indicator-color);
  81. block-size: $timeline-point-size;
  82. box-shadow: 0 0 0 10px var(--#{$prefix}paper-bg);
  83. inline-size: $timeline-point-size;
  84. inset-block-start: 0;
  85. inset-inline-start: -.38rem;
  86. outline: 3px solid rgba(var(--#{$prefix}timeline-point-indicator-outline-color), .12);
  87. }
  88. // Transparent Timeline Item
  89. &.timeline-item-transparent {
  90. .timeline-event {
  91. background-color: transparent;
  92. inset-block-start: -.9rem;
  93. padding-inline: 0;
  94. }
  95. }
  96. }
  97. // Timeline outline
  98. &.timeline-outline {
  99. .timeline-item {
  100. .timeline-point {
  101. border: 2px solid var(--#{$prefix}timeline-point-indicator-color);
  102. background-color: var(--#{$prefix}paper-bg);
  103. outline: unset;
  104. }
  105. }
  106. }
  107. // Timeline Center
  108. &.timeline-center {
  109. .timeline-item {
  110. clear: both;
  111. inline-size: 50%;
  112. .timeline-event {
  113. inset-block-start: 0;
  114. }
  115. .timeline-indicator {
  116. inset-block-start: .64rem;
  117. }
  118. &.timeline-item-left,
  119. &:nth-of-type(odd):not(.timeline-item-left, .timeline-item-right) {
  120. border-inline-end: 1px solid $timeline-border-color;
  121. border-inline-start: 0;
  122. float: inline-start;
  123. padding-block-end: 2.5rem;
  124. padding-inline: 0 2.25rem;
  125. .timeline-event {
  126. .timeline-event-time {
  127. inset-inline-end: -10.2rem;
  128. }
  129. }
  130. .timeline-point {
  131. inset-inline-start: 100%;
  132. margin-inline-start: -.3rem;
  133. }
  134. }
  135. &.timeline-item-right,
  136. &:nth-of-type(even):not(.timeline-item-left, .timeline-item-right) {
  137. border-inline-start: 1px solid $timeline-border-color;
  138. float: inline-end;
  139. inset-inline-end: 1px;
  140. padding-block-end: 2.5rem;
  141. padding-inline: 2.25rem 0;
  142. .timeline-event-time {
  143. inset-inline-start: -10.2rem;
  144. }
  145. }
  146. }
  147. }
  148. }
  149. @include media-breakpoint-up(md) {
  150. .timeline.timeline-center .timeline-item {
  151. &.timeline-item-left,
  152. &:nth-of-type(odd):not(.timeline-item-left, .timeline-item-right) {
  153. .timeline-indicator {
  154. inset-inline-start: calc(100% - calc(#{$timeline-indicator-size}/ 2));
  155. }
  156. &::after {
  157. inset-inline-start: calc(100% - calc(#{$timeline-indicator-size}/ 2));
  158. }
  159. }
  160. }
  161. }
  162. /* To Change Timeline Center's Alignment om small Screen */
  163. @include media-breakpoint-down(md) {
  164. .timeline {
  165. &.timeline-center {
  166. .timeline-end-indicator {
  167. inset-inline-start: -2px;
  168. }
  169. .timeline-item {
  170. border-inline-end: 0 !important;
  171. float: inline-start !important;
  172. inline-size: 100%;
  173. inset-inline-start: 1rem;
  174. padding-inline: 3.5rem 1.5rem !important;
  175. &:not(:last-child) {
  176. border-inline-start: 2px solid $timeline-border-color !important;
  177. }
  178. .timeline-event {
  179. .timeline-event-time {
  180. inset-block-start: -1.4rem;
  181. inset-inline: 0 auto !important;
  182. }
  183. }
  184. }
  185. }
  186. }
  187. }
  188. @include media-breakpoint-down(sm) {
  189. .timeline {
  190. .timeline-header {
  191. flex-direction: column;
  192. align-items: flex-start;
  193. }
  194. }
  195. }
  196. @each $state in map-keys($theme-colors) {
  197. .timeline {
  198. .timeline-point-#{$state}, .timeline-indicator-#{$state} {
  199. --#{$prefix}timeline-point-indicator-bg: var(--#{$prefix}#{$state}-bg-subtle);
  200. --#{$prefix}timeline-point-indicator-color: var(--#{$prefix}#{$state});
  201. --#{$prefix}timeline-point-indicator-outline-color: var(--#{$prefix}#{$state}-rgb);
  202. }
  203. }
  204. }