Really slow css
Is it even possible write css that make your page lagging?
I have some animations and transitions but there isn't that much contect so that could lag.
How to find what causing that lags?
10 Replies
yes, it's possible to write css that lags the page
you gave examples of things that can do that
specially if you let them all animate forever, without any way to pause them when they are outside the viewport
I have gradient animation with 5 colors on 6 components. Is that too much?
depends on the device
but instead of trying to guess, you can measure
the chrome tools have a profiler, which you can use to get a view on what's happening and (hopefully) see what's lagging the page
Okay, I dont know what happen but it just stopped lagging.
did you refresh the page?
reopen the browser?
some properties are efficient to animate and others are not, and sometimes there is a right and wrong way to get the same effect. You can find a list of properties to avoid animating.
some are top, left, bottom and right
use translate instead
Without seeing code or a demo (or both) it's hard to know the problem
and if it is a problem that can be replicated or a device-specific problem