CSS with ERB 2
As I started to get deeper into creating the stylesheet for our latest project, I got annoyed with having to repeat the same color hex codes all over the place. There are many solutions to this dilemma but I liked this one the best. (Note the blog name is a coincidence.)
I had to modify the suggested route slightly as this article is fairly outdated and doesn’t work with the latest rails version that considers dot a separator in routes. So I used this:
map.connect 'stylesheets/:rcss.:format', :controller => 'stylesheets', :action => 'rcss'So far this is working great. I have several color codes setup as instance variables in the controller. Andy suggested I try moving this to perhaps a layout for the css. If the list of variables gets unwieldy I’ll do just that.
Speaking of color hex codes, this car license plate is pretty funny.
Trackbacks
Use the following link to trackback from your own site:
http://blog.kineticweb.com/articles/trackback/47

http://haml.hamptoncatlin.com/docs/sass
I've been using haml a fair bit recently and love it so far. Haven't gotten into SASS yet, but it would solve your variable problem and introduce nested awesomeness.