Yeah, I mean, it's not the best solution in the world, but that's the one
that works pretty reliably.

The major issue is the way in which the import statement works; it
essentially queues the asset to be loaded AFTER the stylesheet itself is
loaded. Most (with some reservations) browsers will load all stylesheets in
the <head> tag before they try to display the page, but this isn't the case
cross browser with @import (as that article shows).

Let me know how removing import works out for you.

On Tue, May 3, 2011 at 12:01 PM, hairbo <[email protected]> wrote:

> Thanks for the reply.  I'm fine with Morph being strict--that's the least
> of my concerns.  (-;
>
> I've never used @import before, but I was attempting it because I thought
> it might be cleaner/sexier/slickeer/whatever for the HTML page to invoke a
> single .css file, which in turn imports all the CSS assets it might need.  I
> have no strong desire or need to use it, and so based on the article you
> sent, I'm going to bail on it.
>
> As for tracking "cssReady", I suppose your solution works, but that totally
> sucks.  The nice part about morphing by class is you can disentangle your JS
> and CSS, but if that means jumping through all sorts of scary hoops to
> ensure your CSS loads before your Morph class fires, then that's no fun at
> all.
>
> I'll see if the code works reliably if I bail on @import.  It sounds like
> there's still a race condition in play, though perhaps the race is won
> almost all the time by the CSS load.  Thanks again for your help.
>

Reply via email to