Hosted YUI 3 CSS – Combine or Not?

Savage Chickens - Hamlet

I really really like YUI’s CSS ResetBase, and Fonts for creating a “blank slate” for new designs.  Grids, not as much — mostly I don’t find the naming conventions to be intuitive, so while they kind of make it easier to get the results I want, maintaining it is a chore and feels like work.  But I digress.

A discussion we’ve had at work a few times: should we use Google’s hosted jQuery?  (Here’s my answer.)  So I wanted to know, what about using Yahoo’s CDN -hosted YUI CSS libraries?  I don’t think so.  Here’s why:

When you combine files, you get a different URL depending on what order you select the components in.  For example, in the configurator:

…and so on.  Of the number of users who just happen to be using only those 3 selections, you still only have a 1 in 9 chance that they selected them in the same order you did.

You can not combine the CSS scripts and get something like this:

That at least gives you a consistent URL, but then you lose 1/2 the benefit of fewer HTTP requests — you get the caching, delivery, and speed but your visitors are making 3 requests instead of 1 the first time they visit your site.  (I’m going to assume that they don’t have these CSS files cached from other places on the web because of the relatively low popularity of YUI CSS combined with the multitude of possible URLs the same CSS can have.)

Let’s not forget you still have to load your own site stylesheet, too.  And since you already have to make that request, the extra weight of including your CSS resets & base is trivial.

So I love YUI CSS, and I am a conditional fan of using the big boys’ CDN hosting, but in this case I just don’t get it.  Just use YUI Compressor and your own CDN.  🙂

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