I was hoping someone could help explain the strange behaviour I'm experiencing in Webkit browsers with unwanted delays in CSS transitions.
Here is a link to the page I'm working on: http://demo.daised.com/help-me
The desired outcome is for the menu bar to shrink as the user scrolls down the page. This animates perfectly in Firefox.
However, in Webkit browsers the transition for font-size of the nav items is delayed by 6(!) seconds.
Thanks for helping me understand this better.
user3360686 is right, your transitions are somehow stacked. I'm not sure why it happens as it's not supposed to.
Anyway what you've done in the header is dangerous, and may trigger weird behaviors :
You have about 25 elements in your header, transitions and delays will be applied to each of them. Use specific elements for more efficiency (and elegance).
Using "all" with transition is generally a bad idea, they are a good means to create conflicts. Use specific properties.
This quick and nice answer sums up pretty much everything : CSS3, WebKit Transition Order? How to queue to the transitions?
Another reason for unwanted delays is with
overflow: hidden;
. If you have a dropdown toggle navbar for example: When it is toggled open, and themax-height
is set to1000px
, whilst also having the CSS propertyoverflow: hidden;
, it will take longer to transition from itsmax-height
to closed.The issue is caused by stacked transitions on elements that inherit the
transition
property.The section of css
a, span
applies the transition to both elements. Thespan
inherits the color from thea
, but does not apply the animation color until thea
has finished its animation.The best fix for the above example would be to remove the rule for
a, span
and placetransition: 0.5s;
inside the rule fora
:I ran into the same problem. My issue was that I was trying to transition properties that were originally being inherited from a parent. It turns out Webkit browser (not Firefox) require each property that you're transitioning to actually be applied to that element. It seems they cannot transition properties that have been inherited.
For example, I was trying to do this:
HTML
CSS
Firefox managed to accomplish this but both Chrome and Safari required this: