Re: Deferring CSS load for unmatched Media Queries

So, it sounds like you want to delineate three distinct categories of
stylesheets:

1. Essential stylesheets.  All current stylesheets are in this
category by default.  Essential stylesheets load eagerly, block script
execution during parsing, etc.
2. Low-priority stylesheets.  These are used on the page, but aren't
important to load quickly.  (That is, a FOUC is okay, or maybe you
won't add the elements that need the style until after you're sure the
style has loaded.)  To handle potential race issues with page script,
the OM for these stylesheets will be nulled until the author
explicitly requests them, even if the sheet has already loaded.
3. High-prio but optional stylesheets.  These are necessary early in
the page, but may not be used, due to MQs.  If the MQ for them is
false on page load, they shouldn't load at all until the MQ becomes
true.  I suspect these would have the same null OM until requested.

Is this accurate?

~TJ

Received on Monday, 4 February 2013 23:57:21 UTC