I'm facing an issue where I have a small CSS file for a loading animation included in my head section. While downloading a large Angular2 application, I want to display this loading animation. However, it seems that the animation doesn't start until all CSS files are loaded from the server.
<link rel="stylesheet" href="~/dist/load.css" />
<link rel="stylesheet" href="~/dist/vendor.css" />
I've attempted various methods such as loading vendor.css
asynchronously, using defer
, or a combination of both. I even tried placing it before the closing </body>
tag. I also experimented with replacing the animation with a GIF, but the same issue persisted - the animation would only begin once vendor.css
was loaded.
When viewing the network tab in Developer Tools and simulating a Slow 3G connection, I noticed that the animation only starts when the vendor.css
file is fully loaded. Removing vendor.css
allowed the animation to start immediately.
Is there a way for me to initiate the animation before the other CSS file finishes loading?