timeline.scss 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265
  1. /* ========================================================================
  2. Component: timeline
  3. ========================================================================== */
  4. $timeline-badge-size : 36px;
  5. $timeline-datetime-height : 20px;
  6. $timeline-separator-width : 120px;
  7. // Timeline container
  8. // --------------------------------
  9. .timeline,
  10. .timeline-alt {
  11. list-style: none;
  12. padding: 0 0 20px;
  13. position: relative;
  14. z-index: 0; // Timeline central line
  15. @include clearfix();
  16. &:before {
  17. position: absolute;
  18. top: 0;
  19. bottom: 0;
  20. content: " ";
  21. width: 1px;
  22. background-color: #d1d2d3;
  23. left: $timeline-badge-size / 2;
  24. } // clear all float element using a last item
  25. .timeline-end {
  26. float: none;
  27. clear: both;
  28. } // change popover default colors to use no title
  29. .popover {
  30. &.left>.arrow:after {
  31. border-left-color: #fff;
  32. }
  33. &.right>.arrow:after {
  34. border-right-color: #fff;
  35. } // but restore the color if we use a title
  36. &.left>.popover-title+.arrow:after {
  37. border-left-color: $popover-arrow-color;
  38. }
  39. &.right>.popover-title+.arrow:after {
  40. border-right-color: $popover-arrow-color;
  41. }
  42. } // Timeline list itmes
  43. // --------------------------------
  44. >li {
  45. @include clearfix();
  46. margin-bottom: 20px;
  47. &.timeline-separator {
  48. position: relative;
  49. float: none;
  50. clear: both;
  51. margin: 0 auto;
  52. padding: 40px 0;
  53. &:first-child {
  54. padding-top: 0;
  55. }
  56. &:before {
  57. content: attr(data-datetime);
  58. display: inline-block;
  59. width: $timeline-separator-width;
  60. text-align: center;
  61. padding: 0 20px;
  62. line-height: 30px;
  63. background-color: #b6c5da;
  64. color: #fff;
  65. }
  66. }
  67. } // Timeline card
  68. // --------------------------------
  69. >li>.timeline-card {
  70. margin-left: $timeline-separator-width / 2; // Popover inside timeline cards
  71. .popover {
  72. position: relative;
  73. display: block;
  74. margin: 0;
  75. width: 100%;
  76. max-width: none;
  77. .arrow {
  78. top: $timeline-badge-size/2;
  79. display: none;
  80. }
  81. .popover-content {
  82. .popover-title {
  83. background-color: transparent;
  84. border: 0;
  85. padding-left: 0;
  86. padding-top: 0;
  87. }
  88. }
  89. }
  90. } // Timeline Date
  91. // --------------------------------
  92. >li>.timeline-date {
  93. margin: -$timeline-datetime-height 0 0;
  94. display: block;
  95. height: $timeline-datetime-height;
  96. line-height: $timeline-datetime-height;
  97. font-size: 13px;
  98. >time {
  99. &:after {
  100. content: attr(datetime);
  101. }
  102. }
  103. } // Timeline badges
  104. // --------------------------------
  105. >li>.timeline-badge {
  106. position: absolute;
  107. left: 0;
  108. width: $timeline-badge-size;
  109. height: $timeline-badge-size;
  110. border-radius: 500px;
  111. line-height: $timeline-badge-size;
  112. font-size: 1em;
  113. text-align: center;
  114. color: #fff;
  115. background-color: #999;
  116. z-index: 100; // Color variants
  117. &.primary {
  118. background-color: $primary;
  119. }
  120. &.success {
  121. background-color: $success;
  122. }
  123. &.warning {
  124. background-color: $warning;
  125. }
  126. &.danger {
  127. background-color: $danger;
  128. }
  129. &.info {
  130. background-color: $info;
  131. }
  132. &.inverse {
  133. background-color: $inverse;
  134. }
  135. &.green {
  136. background-color: $green;
  137. }
  138. &.pink {
  139. background-color: $pink;
  140. }
  141. &.purple {
  142. background-color: $purple;
  143. }
  144. &.dark {
  145. background-color: $dark;
  146. }
  147. &.yellow {
  148. background-color: $yellow;
  149. }
  150. }
  151. }
  152. .timeline-alt {
  153. .popover .arrow {
  154. display: block !important;
  155. }
  156. }
  157. // Timeline title
  158. // --------------------------------
  159. .timeline-title {
  160. margin-top: 0;
  161. color: inherit;
  162. }
  163. // Timeline Body
  164. // --------------------------------
  165. .timeline-body>p,
  166. .timeline-body>ul {
  167. margin-bottom: 0;
  168. }
  169. .timeline-body>p+p {
  170. margin-top: 5px;
  171. }
  172. // Timeline for Desktops
  173. // --------------------------------
  174. @include media-breakpoint-up(lg) {
  175. .timeline {
  176. &:before {
  177. left: 50%;
  178. margin-left: ($timeline-badge-size/2);
  179. }
  180. >li {
  181. float: left;
  182. clear: left;
  183. width: 45%;
  184. &.timeline-inverted {
  185. float: right;
  186. clear: right;
  187. margin-top: 50px;
  188. }
  189. }
  190. >li.timeline-separator {
  191. text-align: center;
  192. &:before {
  193. margin-left: ($timeline-badge-size);
  194. }
  195. }
  196. >li>.timeline-badge {
  197. left: 50%;
  198. margin-left: 0;
  199. }
  200. >li>.timeline-date {
  201. float: none;
  202. position: absolute;
  203. width: 40%;
  204. left: 50%;
  205. top: $timeline-badge-size / 2;
  206. margin-left: $timeline-badge-size * 1.5;
  207. margin-top: -($timeline-datetime-height/2);
  208. }
  209. >li>.timeline-card {
  210. margin: 0;
  211. &:before {
  212. border-left-width: 15px;
  213. border-right-width: 0;
  214. top: 26px;
  215. right: -15px;
  216. left: auto;
  217. }
  218. &:after {
  219. border-left-width: 14px;
  220. border-right-width: 0;
  221. top: 27px;
  222. right: -14px;
  223. left: auto;
  224. }
  225. .popover .arrow {
  226. display: block;
  227. }
  228. } // Timeline inverted
  229. // --------------------------------
  230. >li.timeline-inverted {
  231. >.timeline-card {
  232. padding-left: $timeline-badge-size;
  233. }
  234. .timeline-date {
  235. left: auto;
  236. right: 50%;
  237. width: auto;
  238. margin-left: 0;
  239. margin-right: $timeline-badge-size;
  240. }
  241. }
  242. }
  243. }