CSS Framework

17 January 2007

In the programming it’s always good habit to try to automate the repetitive tasks and avoid reinventing the wheel. Often this means to adopt a framework. This rule is true also for the writing of the CSS, even if call it programming is improper.

Making a new site we often repeat the same things, for the code and for the hack. And you must consider not only the developing time but also its maintenance: a modification can even become necessary months later from the first release.

Despite the fact experienced developers builds their own workflow, it’s ever good habit to peek at other works.

The most interesting framework I find on the net are (at time of writing):

A framework can be a big helper, but you must know what you are doing. A framework are not for absolute beginners, you must study its code and learn its funcionalities and behaviour.

A common approach is to split all the instructions in different stilesheets, resulting in better organization targeting single scope (layout, tipography, forms, …)

Content with Style: A CSS Framework

Surely my preferred. It has a XHTML to start and personilize including only the styles you need. All the CSS files are well commented and switching to another layout it’s very easy.

WYMstyle – CSS framework

It’s very modular, the layout must be made assembling various CSS files like bricks. It’s suitable for complex layouts, the base file has many more structural elements. At a first glance, it has confuseed me, but it requires more time to study.

Yahoo! UI Library: Grids CSS

I haven’t tried it! The approach of Yahoo’s framework does not contains any semantic (see Standardizing CSS class and id names) and I find the code so complex to became hard to assimilate.

I know it’s good and robust, but it receive some bad comments:

If somebody makes a CSS framework that cuts out the work for some hacks and browser quirks, that’d be great. But no framework should have to require unsemantic code and force a developer to use HTML in order to achieve styles. Granted, somethings such as curved corners can require a few extra elements. But this is just ridiculous. (YUI Grids CSS framework considered harmful.)

Conclusion

I will not use anyone! These frameworks are good works, but every developer must build his own tools. Take all these frameworks as inspiration to build your very own CSS framework.

If you build web templates you know the big job is not in the layout but in the subtles: molding the graphics, study the tipography and the colors, add unobtrusive javascript, etc. Vast majority of layouts are the same (2 columns, 3 columns, with or without a fotter, …) so build a bunch of this common layout and use it as starting point to build a template project.

Comments

Insert your comment