|
10 | 10 | * (.next/.prev/.left/.right); that machinery went away with the Bootstrap |
11 | 11 | * carousel JS (Track A — issues #1288 / #1253), so the fade is now self- |
12 | 12 | * contained CSS rather than a hack layered on Bootstrap's animation. |
| 13 | + * |
| 14 | + * Dip-free crossfade (issue #1010): the transition is asymmetric on purpose. |
| 15 | + * The INCOMING slide fades in (opacity 0 -> 1) while the OUTGOING slide holds |
| 16 | + * at full opacity, then snaps to 0 only after the incoming has fully covered |
| 17 | + * it. This guarantees an opaque slide always covers the carousel's magenta |
| 18 | + * gradient backdrop (#main-carousel in base.css). A naive *symmetric* crossfade |
| 19 | + * (both slides fading at once) lets up to ~25% of that backdrop bleed through |
| 20 | + * at the midpoint, which read as a "blink"/flash when switching banners. |
13 | 21 | */ |
14 | 22 |
|
15 | 23 | .carousel-fade .carousel-inner > .item { |
|
23 | 31 | z-index: 0; |
24 | 32 | /* Only the visible slide should capture clicks. */ |
25 | 33 | pointer-events: none; |
26 | | - transition: opacity 0.6s ease-in-out; |
| 34 | + /* Deactivating: hold opacity (0s change) until the incoming slide has faded |
| 35 | + fully in, i.e. delay the snap-to-0 by the fade duration. */ |
| 36 | + transition: opacity 0s ease-in-out 0.6s; |
27 | 37 | } |
28 | 38 |
|
29 | 39 | .carousel-fade .carousel-inner > .item.active { |
30 | 40 | opacity: 1; |
31 | 41 | z-index: 1; |
32 | 42 | pointer-events: auto; |
| 43 | + /* Activating: fade in over the still-opaque outgoing slide. */ |
| 44 | + transition: opacity 0.6s ease-in-out 0s; |
33 | 45 | } |
34 | 46 |
|
35 | 47 | /* Respect users who prefer reduced motion: switch instantly, no crossfade. |
36 | 48 | (carousel.js also disables autoplay under this preference.) */ |
37 | 49 | @media (prefers-reduced-motion: reduce) { |
38 | | - .carousel-fade .carousel-inner > .item { |
| 50 | + .carousel-fade .carousel-inner > .item, |
| 51 | + .carousel-fade .carousel-inner > .item.active { |
39 | 52 | transition: none; |
40 | 53 | } |
41 | 54 | } |
0 commit comments