css_dryer: DRY Up Your CSS
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.
December 18, 2006 at 9:18 am
Do you know if there is a caching mechanism inside this plugin ? Thank you.
December 18, 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 4, 2007 at 5:03 pm
Sandro, I've just released an update to the plugin and it now caches stylesheets.