|
3 | 3 | --marker-size-block: 32px; |
4 | 4 | --marker-size-inline: var(--marker-size-block); |
5 | 5 | --marker-size-half: calc(var(--marker-size-block) * 0.5); |
6 | | - --marker-spacing: -1px; /* Fix for rounding errors */ |
| 6 | + --marker-spacing: 0px; |
7 | 7 |
|
8 | 8 | --marker-bg: #999; |
9 | 9 | --marker-bg-active: #0034a3; |
|
152 | 152 | --bg: var(--marker-bg-hover); |
153 | 153 | } |
154 | 154 |
|
| 155 | + /* Alignment */ |
| 156 | + |
| 157 | + .progress-tracker--center { |
| 158 | + --path-position-inline: calc(50% + (var(--marker-size-inline) / 2) + var(--marker-spacing)); |
| 159 | + |
| 160 | + text-align: center; |
| 161 | +} |
| 162 | + |
| 163 | + .progress-tracker--center:not(.progress-tracker--vertical) .progress-step::before { |
| 164 | + margin-left: auto; |
| 165 | + margin-right: auto; |
| 166 | + } |
| 167 | + |
| 168 | + .progress-tracker--center.progress-tracker--vertical { |
| 169 | + max-width: 240px; |
| 170 | + margin-left: auto; |
| 171 | + margin-right: auto; |
| 172 | + } |
| 173 | + |
| 174 | + .progress-tracker--end { |
| 175 | + --path-position-inline: calc(100% + var(--marker-spacing)); |
| 176 | + |
| 177 | + text-align: right; |
| 178 | +} |
| 179 | + |
| 180 | + .progress-tracker--end:not(.progress-tracker--vertical) .progress-step::before { |
| 181 | + margin-left: auto; |
| 182 | + } |
| 183 | + |
| 184 | + .progress-tracker--end.progress-tracker--vertical .progress-step { |
| 185 | + flex-direction: row-reverse; |
| 186 | + } |
| 187 | + |
| 188 | + .progress-tracker--end.progress-tracker--vertical .progress-step::after { |
| 189 | + left: auto; |
| 190 | + right: var(--path-position-block); |
| 191 | + } |
| 192 | + |
| 193 | + .progress-tracker--reverse:not(.progress-tracker--vertical) .progress-step::after { |
| 194 | + top: auto; |
| 195 | + bottom: var(--path-position-block); |
| 196 | + } |
| 197 | + |
| 198 | + .progress-tracker--reverse.progress-tracker--marker-square .progress-step::after { |
| 199 | + top: auto; |
| 200 | + bottom: 0; |
| 201 | + } |
| 202 | + |
| 203 | + .progress-tracker--reverse .progress-text { |
| 204 | + order: -1; |
| 205 | + flex-grow: 1; |
| 206 | + } |
| 207 | + |
155 | 208 | /* Variants */ |
156 | 209 |
|
157 | 210 | .progress-tracker--marker-counter .progress-step::before { |
|
164 | 217 | content: attr(data-text, ""); |
165 | 218 | } |
166 | 219 |
|
| 220 | + .progress-tracker--dashed, .progress-tracker--dashed-even { |
| 221 | + --path-dash-size: 8px; |
| 222 | + --path-dash-count: 0; |
| 223 | + --path-dash-calc: var(--path-dash-size); |
| 224 | + --path-direction: right; |
| 225 | + --marker-spacing: 8px; |
| 226 | +} |
| 227 | + |
| 228 | + .progress-tracker--dashed .progress-step:not(:last-child)::after, .progress-tracker--dashed-even .progress-step:not(:last-child)::after { |
| 229 | + background: repeating-linear-gradient(to var(--path-direction), var(--bg) 0px var(--path-dash-calc), transparent var(--path-dash-calc) calc(var(--path-dash-calc)*2)); |
| 230 | + } |
| 231 | + |
| 232 | + .progress-tracker--dashed.progress-tracker--vertical, .progress-tracker--dashed-even.progress-tracker--vertical { |
| 233 | + --path-direction: bottom; |
| 234 | + } |
| 235 | + |
| 236 | + .progress-tracker--dashed-even { |
| 237 | + --path-dash-size: 0px; |
| 238 | + --path-dash-count: 4; |
| 239 | + --path-dash-percent: calc(100% / (var(--path-dash-count) + (var(--path-dash-count) - 1))); |
| 240 | + --path-dash-calc: calc(100% / (var(--path-dash-count) + (var(--path-dash-count) - 1))); |
| 241 | + --path-dash-calc: var(--path-dash-percent); |
| 242 | + --marker-spacing: 0px; |
| 243 | +} |
| 244 | + |
| 245 | + @supports (height: round(up, 100.1px, 1px)) { |
| 246 | + |
| 247 | + .progress-tracker--dashed-even { |
| 248 | + --path-dash-calc: round(up, var(--path-dash-percent), .5px); |
| 249 | +} |
| 250 | + } |
| 251 | + |
| 252 | + .progress-tracker--spaced { |
| 253 | + --marker-spacing: 8px; |
| 254 | +} |
| 255 | + |
167 | 256 | .progress-tracker--marker-square { |
168 | 257 | --marker-size-block: 24px; |
169 | 258 | --marker-size-inline: 4px; |
|
174 | 263 | border-radius: 0; |
175 | 264 | } |
176 | 265 |
|
177 | | - .progress-tracker--spaced { |
178 | | - --marker-spacing: 8px; |
179 | | -} |
| 266 | + .progress-tracker--marker-square.progress-tracker--vertical { |
| 267 | + --marker-size-inline: 24px; |
| 268 | + --marker-size-block: 4px; |
| 269 | + --path-size-inline: calc(100% - (var(--marker-spacing) * 2)); |
| 270 | + } |
| 271 | + |
| 272 | + .progress-tracker--anim .progress-step.is-active:not(:last-child)::after, .progress-tracker--anim .progress-step.is-complete:not(:last-child)::after { |
| 273 | + background-image: linear-gradient(to right, var(--path-bg-active) 50%, var(--path-bg-complete) 50%); |
| 274 | + background-size: 200% 100%; |
| 275 | + background-position: 0% 100%; |
| 276 | + } |
| 277 | + |
| 278 | + .progress-tracker--anim .progress-step.is-complete:not(:last-child)::after { |
| 279 | + background-position: -100% 100%; |
| 280 | + } |
| 281 | + |
| 282 | + .progress-tracker--anim.progress-tracker--vertical .progress-step.is-active:not(:last-child)::after, .progress-tracker--anim.progress-tracker--vertical .progress-step.is-complete:not(:last-child)::after { |
| 283 | + background-image: linear-gradient(to bottom, var(--path-bg-active) 50%, var(--path-bg-complete) 50%); |
| 284 | + background-size: 100% 200%; |
| 285 | + background-position: 100% 0%; |
| 286 | + } |
| 287 | + |
| 288 | + .progress-tracker--anim.progress-tracker--vertical .progress-step.is-complete:not(:last-child)::after { |
| 289 | + background-position: 100% -100%; |
| 290 | + } |
180 | 291 |
|
181 | 292 | .progress-tracker--inline { |
182 | 293 | overflow: auto; |
|
210 | 321 | flex-basis: min-content; |
211 | 322 | } |
212 | 323 |
|
213 | | - .progress-tracker--inline:not(.progress-tracker--inline-text-right) .progress-step:first-child .progress-text { |
| 324 | + .progress-tracker--inline:not(.progress-tracker--inline-text-end) .progress-step:first-child .progress-text { |
214 | 325 | padding-left: 0; |
215 | 326 | } |
216 | 327 |
|
217 | | - .progress-tracker--inline-text-right .progress-text { |
| 328 | + .progress-tracker--inline-text-end .progress-text { |
218 | 329 | order: 2; |
219 | 330 | } |
220 | 331 |
|
|
238 | 349 | padding-top: 4px; |
239 | 350 | padding-bottom: 12px; |
240 | 351 | } |
241 | | - |
242 | | - .progress-tracker--center { |
243 | | - --path-position-inline: calc(50% + (var(--marker-size-inline) / 2) + var(--marker-spacing)); |
244 | | - |
245 | | - text-align: center; |
246 | | -} |
247 | | - |
248 | | - .progress-tracker--center:not(.progress-tracker--vertical) .progress-step::before { |
249 | | - margin-left: auto; |
250 | | - margin-right: auto; |
251 | | - } |
252 | | - |
253 | | - .progress-tracker--center.progress-tracker--vertical { |
254 | | - max-width: 240px; |
255 | | - margin-left: auto; |
256 | | - margin-right: auto; |
257 | | - } |
258 | | - |
259 | | - .progress-tracker--right { |
260 | | - --path-position-inline: calc(100% + var(--marker-spacing)); |
261 | | - |
262 | | - text-align: right; |
263 | | -} |
264 | | - |
265 | | - .progress-tracker--right:not(.progress-tracker--vertical) .progress-step::before { |
266 | | - margin-left: auto; |
267 | | - } |
268 | | - |
269 | | - .progress-tracker--right.progress-tracker--vertical .progress-step { |
270 | | - flex-direction: row-reverse; |
271 | | - } |
272 | | - |
273 | | - .progress-tracker--right.progress-tracker--vertical .progress-step::after { |
274 | | - left: auto; |
275 | | - right: var(--path-position-block); |
276 | | - } |
277 | | - |
278 | | - .progress-tracker--reverse:not(.progress-tracker--vertical) .progress-step::after { |
279 | | - top: auto; |
280 | | - bottom: var(--path-position-block); |
281 | | - } |
282 | | - |
283 | | - .progress-tracker--reverse.progress-tracker--marker-square .progress-step::after { |
284 | | - top: auto; |
285 | | - bottom: 0; |
286 | | - } |
287 | | - |
288 | | - .progress-tracker--reverse .progress-text { |
289 | | - order: -1; |
290 | | - flex-grow: 1; |
291 | | - } |
292 | | - |
293 | | - .progress-tracker--anim .progress-step.is-active:not(:last-child)::after, .progress-tracker--anim .progress-step.is-complete:not(:last-child)::after { |
294 | | - background-image: linear-gradient(to right, var(--path-bg-active) 50%, var(--path-bg-complete) 50%); |
295 | | - background-size: 200% 100%; |
296 | | - background-position: 0% 100%; |
297 | | - } |
298 | | - |
299 | | - .progress-tracker--anim .progress-step.is-complete:not(:last-child)::after { |
300 | | - background-position: -100% 100%; |
301 | | - } |
302 | | - |
303 | | - .progress-tracker--anim.progress-tracker--vertical .progress-step.is-active:not(:last-child)::after, .progress-tracker--anim.progress-tracker--vertical .progress-step.is-complete:not(:last-child)::after { |
304 | | - background-image: linear-gradient(to bottom, var(--path-bg-active) 50%, var(--path-bg-complete) 50%); |
305 | | - background-size: 100% 200%; |
306 | | - background-position: 100% 0%; |
307 | | - } |
308 | | - |
309 | | - .progress-tracker--anim.progress-tracker--vertical .progress-step.is-complete:not(:last-child)::after { |
310 | | - background-position: 100% -100%; |
311 | | - } |
|
0 commit comments