I Love YUI

Yahoo! has made a lot of cool resources available for web developers. They have libraries to login using Yahoo! credentials, perform searches, etc. But one of my favorite, one that I think has no equal even from the mighty Google is their Yahoo! User Interface library (YUI). It’s a great collection of JavaScript pieces which have been beautifully tailored to be useful to total JavaScript know nothings like me and experts as well. They then marry those with a set of excellent CSS files to handle common needs and test the whole mess on every major browser (or at least the ones making up 95% of the traffic to your site). Regular updates to expand the library or the documentation, and keep it up with the latest advances in browser technology are also de rigueur. If you’ve ever found yourself needing menus, tabs, color pickers, calendars, etc. for your website, go to the YUI site.

However, if you’re using Ruby on Rails to do your web development these days then you know that Rails is already well integrated with the JavaScript libraries Prototype and Scriptaculous. If you’re like me, you don’t want to give up that easy integration and you may still be too new with Ruby and Rails to figure out how to use YUI’s JavaScript parts instead. Anybody doing a website that is for Internet use rather than internal business use can’t afford to use both sets of libraries on their pages because of bandwidth and time costs. But that doesn’t mean you have to throw all of YUI out. After all, there’s still the CSS!

YUI offers four CSS files at present:

reset.css Removes all the existing browser styles so that differences in how Internet Explorer styles a <li> or <b> from how Firefox does it are gone.
base.css Provides default styles for all the elements so they will look the same across browsers.
fonts.css Provides consistent font sizing across browsers.
grids.css Provides a great way to layout complex pages with multiple parts within parts, centering, sizes, etc. without having to resort to tables.

I used them on LOL.com and was very happy with how uniform they made my pages look across different browsers. It’s usually hard work to do a layout with many parts to it and lots of formatting and test it various places. With YUI CSS I was able to do it once and do some fairly light testing and still get a very consistent look.

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