Looks like doc.ready fires before CSS has been applied, how can I avoid it?

Sounds like a Browsersync issue, and also an old one:

Right now I’m working on my theme’s UX as it relates to initial page load, which involves hidden content and transitions that reveal content. It’s not playing nicely with the way the CSS is getting injected via JS because of how the page first starts with no CSS, and initial styling of elements is affected as a result, which interferes with my JS revealing code. I’m trying to test this as closely from the point of view of a member of the public as possible, from the initial page load, so I’m deliberately bypassing BrowserSync to run these tests (accessing directly via devurl.dev ). But even on devurl.dev the loading of CSS is noticeably delayed and causing problems with the UX; I guess webpack is what injects the CSS?

from