Also, if you haven’t the foggiest notion what SASS is (”… now there’s a frood who really knows where his towel is.”) you should probably read up on Hampton Catlin’s site about HAML and SASS.
To start things off, I looked around the net for what was already available on the subject. I already knew about Blueprint, though I had never really worked with it, and I learned about the YUI CSS grids toolkit.
Both of these CSS frameworks are very powerful. Personally, I don’t need that much power for this proof of concept, and it probably would have taken more time to adapt one of the frameworks into SASS than it would to program something from the ground up. So instead I just whipped out my text editor and started hacking.
I am a huge fan of HAML for generating templates in Rails.
A feature I was previously unaware of in HAML is that you can mix regular XHTML code in with the HAML code. This is especially useful for inserting an XML prolog to your template layout. I recently saw this exemplified on Robot Has No Heart
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
%html{"xmlns"=>"http://www.w3.org/1999/xhtml", "lang"=>"en"}
%head
%title Layout Example
%body= yield
Cool, huh?
As you may know, adding an XML prolog forces Internet Explorer 6 for Windows into Quirks Mode even though a doctype has been declared, while other browsers remain in Strict Mode. So this can be useful when you need to specify a massively different stylesheet to IE6 in Quirks Mode, while remaining in Strict Mode for your main stylesheet for all other browsers.
Another useful application of this technique is whipping together sites in StaticMatic. Textarea tags give me whitespace headaches in HAML, so now I just write the actual XHTML tag for it. No problems. I use StaticMatic to build page templates that will be ported over to another application. Yes… that’s how much I love HAML.