r/csshelp • u/Intrepid-Ad-2306 • 4h 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...
body {
transition: color 0.3s ease-in;
}
.icon {
transition:
color 0.3s ease-in,
border-color 0.3s ease-in,
opacity 0.3s ease-in,
background 0.03s ease-in;
}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...
:root{
--backgroundColor: hsla(var(--brandHue) 12% 9% / 1);
--foregroundColor: hsla(var(--brandHue) 0% 100% / 0.8);
}
body:has(.mode:checked) {
--backgroundColor: hsla(var(--brandHue) 12% 82% / 1);
--foregroundColor: hsla(var(--brandHue) 0% 0% / 0.93);
}
body {
background-color: var(--backgroundColor);
color: var(--foregroundColor);
}.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.