I really really like YUI’s CSS Reset, Base, 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:
- If you click cssfonts, cssbase, then cssreset you get this URL:
- If you click cssreset, cssbase, then cssfonts you get this URL:
…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. 🙂
- YUI 3 – Yahoo! User Interface Library (developer.yahoo.com)
- Web Designer Notebook ” Are CSS Frameworks Evil? (webdesignernotebook.com)
- CSS Framework By Nyros Developer (slideshare.net)
- Should You Reset Your CSS? (sixrevisions.com)
- The History of CSS Resets (sixrevisions.com)