r/csshelp • u/Intrepid-Ad-2306 • 29d ago
animation happening in series instead of parallel?
(edit - this is an issue specifically in safari. works properly in chrome.)
as far as i'm aware, the default behavior for css animation is to run everything in parallel. if that's the case, i'm completely confused why this is happening.
i have this css...
}
}
but the color transition happens on the body followed by the color transition on the .icon elements.
there are no other transitions anywhere else in the css.
the colors for both are set in the css and not touched by javascript. the change is triggered by turning on or off a checkbox so it's purely css...
}
}
}
.icon has color: inherit and only changes when the body color changes. the other text on the page transitions first then the text with class .icon.
the desired behavior is for all text to change color simultaneously with a 0.3s transition.
3
u/testingaurora 29d ago
Please make a live example, with a minimal reproduction of the issue. Eg codepen https://pen.new
1
u/DickBrainTime 27d ago
I suspect the double transition is the issue. The body is animating its color, but .icon inherits that changing color and also has its own 0.3s color transition. That can look like the icon is chasing the parent's animation, particularly in Safari.
Try removing the color transition from .icon while keeping color: inherit; the icon should simply follow the body's animated color. If you want each element to transition independently, give .icon its final color explicitly with color: var(--foregroundColor) instead of inherit, and retain its color transition. A minimal Safari CodePen would confirm which behavior you're hitting.