Post by Peter Cooper on December 17th, 2006
css_dryer: DRY Up Your CSS

- Haml 1.5 Released
- HAML: A new view template language for Rails
- Capistrano Security Issue - SVN info often publicly viewable


css_dryer is a Rails plugin by Andrew Stewart that makes putting together stylesheets for your Rails applications more efficient than ever before. It supports nesting and basic variable interpolation. For example, here's an example of nesting:
div {
/* comment for div */
color: green;
p {
/* comment for div p */
color: red;
b { color: blue; }
}
}
And using variables makes it easy to update constants in your stylesheet:
<% sleek_grey = '#fefefe' %>
#sidebar { border: 1px solid <%= sleek_grey %> }
#footer { footer: 1px dashed <%= sleek_grey %> }
Andrew has put together some great instructions on how to get it all going here.

Click here to add on del.icio.us









December 18th, 2006 at 9:18 am
Do you know if there is a caching mechanism inside this plugin ? Thank you.
December 18th, 2006 at 9:21 am
Hi Sandro, there's no caching mechanism at the moment but it's high up on the to-do list.
January 4th, 2007 at 5:03 pm
Sandro, I've just released an update to the plugin and it now caches stylesheets.