|
| 1 | +@use 'sass:list'; |
| 2 | +@use "derived-variables" as *; |
| 3 | +@use "initial-variables" as *; |
| 4 | + |
| 5 | +$timeline-marker-size: 12px !default |
| 6 | +$timeline-marker-color: $grey-lighter !default |
| 7 | +$timeline-marker-icon-size: 24px !default |
| 8 | +$timeline-marker-border-size: 1px !default |
| 9 | +$timeline-marker-border: $timeline-marker-border-size solid $timeline-marker-color !default |
| 10 | +$timeline-line-color: $grey-lighter !default |
| 11 | +$timeline-line-width: 1px !default |
| 12 | +$timeline-line-style: solid !default |
| 13 | +$timeline-line: $timeline-line-width $timeline-line-style $timeline-line-color !default |
| 14 | +$timeline-content-padding: 1em 0 0 2em !default |
| 15 | +$timeline-rtl-content-padding: 1em 2em 0 0 !default |
| 16 | +$timeline-icon-size: .75rem !default |
| 17 | +$timeline-header-width: 4em !default |
| 18 | +$timeline-item-padding-left: $timeline-header-width * 0.5 !default |
| 19 | +$timeline-item-padding-bottom: 2em !default |
| 20 | +$dimensions: 16 24 32 48 64 96 128 !default |
| 21 | + |
| 22 | +.timeline |
| 23 | + display: flex |
| 24 | + flex-direction: column |
| 25 | + .timeline-header |
| 26 | + width: $timeline-header-width |
| 27 | + min-width: $timeline-header-width |
| 28 | + max-width: $timeline-header-width * 2 |
| 29 | + word-wrap: normal |
| 30 | + text-align: center |
| 31 | + display: flex |
| 32 | + justify-content: center |
| 33 | + .timeline-item |
| 34 | + display: flex |
| 35 | + display: -ms-flexbox |
| 36 | + display: -webkit-flex |
| 37 | + position: relative |
| 38 | + margin-left: $timeline-item-padding-left |
| 39 | + padding-bottom: $timeline-item-padding-bottom |
| 40 | + &::before |
| 41 | + content: "" |
| 42 | + background-color: $timeline-line-color |
| 43 | + display: block |
| 44 | + width: $timeline-line-width |
| 45 | + height: 100% |
| 46 | + position: absolute |
| 47 | + left: -($timeline-line-width * 0.5) |
| 48 | + top: 0 |
| 49 | + |
| 50 | + .timeline-marker |
| 51 | + position: absolute |
| 52 | + background: $timeline-marker-color |
| 53 | + border: $timeline-marker-border |
| 54 | + border-radius: 100% |
| 55 | + content: "" |
| 56 | + display: block |
| 57 | + height: $timeline-marker-size |
| 58 | + transform: translateX(-50%) |
| 59 | + top: 1.2rem |
| 60 | + width: $timeline-marker-size |
| 61 | + &.is-image |
| 62 | + @each $dimension in $dimensions |
| 63 | + &.is-#{$dimension}x#{$dimension} |
| 64 | + height: $dimension * 1px |
| 65 | + width: $dimension * 1px |
| 66 | + background: $timeline-marker-color |
| 67 | + border: $timeline-marker-border |
| 68 | + border-radius: 100% |
| 69 | + display: block |
| 70 | + overflow: hidden |
| 71 | + &.is-icon |
| 72 | + display: flex |
| 73 | + align-items: center |
| 74 | + justify-content: center |
| 75 | + height: $timeline-marker-icon-size |
| 76 | + width: $timeline-marker-icon-size |
| 77 | + background: $timeline-marker-color |
| 78 | + border: $timeline-marker-border |
| 79 | + border-radius: 100% |
| 80 | + padding: .5rem |
| 81 | + > * |
| 82 | + font-size: $timeline-icon-size !important |
| 83 | + &.is-outlined |
| 84 | + .image |
| 85 | + background: $white |
| 86 | + &.is-icon |
| 87 | + background: $white |
| 88 | + > * |
| 89 | + color: $timeline-marker-color |
| 90 | + @each $name, $pair in $colors |
| 91 | + $color: list.nth($pair, 1) |
| 92 | + $color-invert: list.nth($pair, 1) |
| 93 | + @if list.length($pair) == 2 |
| 94 | + $color-invert: list.nth($pair, 2) |
| 95 | + &.is-#{$name} |
| 96 | + background-color: $color !important |
| 97 | + border-color: $color !important |
| 98 | + .image |
| 99 | + border-color: $color !important |
| 100 | + |
| 101 | + &.is-icon |
| 102 | + background-color: $color !important |
| 103 | + border-color: $color !important |
| 104 | + > * |
| 105 | + color: $color-invert !important |
| 106 | + &.is-outlined |
| 107 | + background-color: $white !important |
| 108 | + border-color: $color !important |
| 109 | + .image |
| 110 | + background-color: $white !important |
| 111 | + &.is-icon |
| 112 | + background-color: $white !important |
| 113 | + > * |
| 114 | + color: $color !important |
| 115 | + .timeline-content |
| 116 | + padding: $timeline-content-padding |
| 117 | + .heading |
| 118 | + font-weight: $weight-semibold |
| 119 | + |
| 120 | + @each $name, $pair in $colors |
| 121 | + $color: list.nth($pair, 1) |
| 122 | + $color-invert: list.nth($pair, 1) |
| 123 | + @if list.length($pair) == 2 |
| 124 | + $color-invert: list.nth($pair, 2) |
| 125 | + &.is-#{$name} |
| 126 | + &::before |
| 127 | + background-color: $color |
| 128 | + |
| 129 | + &.is-centered |
| 130 | + .timeline-header |
| 131 | + display: flex |
| 132 | + width: 100% |
| 133 | + align-self: center |
| 134 | + .timeline-item |
| 135 | + width: 50% |
| 136 | + align-self: flex-end |
| 137 | + flex-direction: row |
| 138 | + &:nth-of-type(2n) |
| 139 | + align-self: flex-start |
| 140 | + flex-direction: row-reverse |
| 141 | + margin-left: 0 |
| 142 | + margin-right: $timeline-item-padding-left |
| 143 | + &::before |
| 144 | + right: -($timeline-line-width * 0.5) |
| 145 | + left: auto |
| 146 | + .timeline-marker |
| 147 | + transform: translateX(50%) |
| 148 | + .timeline-content |
| 149 | + padding: $timeline-rtl-content-padding |
| 150 | + text-align: right |
| 151 | + display: flex |
| 152 | + flex-direction: column |
| 153 | + align-items: flex-end |
| 154 | + flex-basis: 100% |
| 155 | + &:nth-of-type(2n+1) |
| 156 | + &::before |
| 157 | + content: "" |
| 158 | + background-color: $timeline-line-color |
| 159 | + display: block |
| 160 | + width: $timeline-line-width |
| 161 | + height: 100% |
| 162 | + position: absolute |
| 163 | + top: 0 |
| 164 | + @each $name, $pair in $colors |
| 165 | + $color: list.nth($pair, 1) |
| 166 | + $color-invert: list.nth($pair, 1) |
| 167 | + @if list.length($pair) == 2 |
| 168 | + $color-invert: list.nth($pair, 2) |
| 169 | + &.is-#{$name} |
| 170 | + &::before |
| 171 | + background-color: $color |
| 172 | + |
| 173 | + &.is-rtl |
| 174 | + justify-content: flex-end |
| 175 | + align-items: flex-end |
| 176 | + .timeline-item |
| 177 | + justify-content: flex-end |
| 178 | + flex-direction: row |
| 179 | + border-left: none |
| 180 | + &::before |
| 181 | + right: 0 |
| 182 | + left: auto |
| 183 | + margin-left: 0 |
| 184 | + margin-right: $timeline-header-width * 0.5 |
| 185 | + .timeline-marker |
| 186 | + transform: translateX(50%) |
| 187 | + &.is-image |
| 188 | + @each $dimension in $dimensions |
| 189 | + &.is-#{$dimension}x#{$dimension} |
| 190 | + transform: translateX(50%) |
| 191 | + .timeline-content |
| 192 | + padding: $timeline-rtl-content-padding |
| 193 | + text-align: right |
| 194 | + |
| 195 | + &.no-headers |
| 196 | + .timeline-item |
| 197 | + &.is-first |
| 198 | + &::before |
| 199 | + height: calc(100% - 1.2rem) |
| 200 | + top: 1.2rem |
| 201 | + &.is-last |
| 202 | + &::before |
| 203 | + height: 1.2rem |
0 commit comments