Conditional Loading of Resources with mediaqueries

Did you know that, regardless of the device screen size, all of these CSS files will be loaded?
<link href="all.css" rel="stylesheet">
<link href="small.css" rel="stylesheet" media="screen and (min-width: 600px)">
<link href="big.css" rel="stylesheet" media="screen and (min-width: 4000px)">

To help avoid this, Chris offers an elegant, albeit JavaScript-reliant, solution:
http://christianheilmann.com/2012/12/19/conditional-loading-of-resources-with-mediaqueries/

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s