A while back I did a small post on parsing HTML/XML files and extracting the ids and classes into a generated CSS file. I finally got around to refactoring and packaging it into a ruby gem. This can help you rapidly prototype your markup without having to write the CSS at the same time. Use the gem to generate a scaffold CSS file that you can then fill out. The generated CSS file can also be used as a template for generating multiple “themes” for your html/xml markup :-).
You can install the CSSPrimer gem as usual with ruby gems.
–> gem install css_primer
For full documentation and examples check out the source code on github.
Next plans:
- get a working Redcar plugin!
- generating a CSS file from multiple html source files
Filed under: General Announcements, Ruby, Technical






Just used it. BRILLIANT! Thank you. Saved me from having to write something similar in AppleScript.
[...] Priming CSS, For Fun. Posted on January 26, 2010 by Brent Lintner *Update* More relevant post: http://tinyhippos.com/2010/06/09/css-priming-for-fun-part-2-cssprimer-0-1/ [...]