<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="/stylesheets/rss.css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>has_many :thoughts: CSS with ERB</title>
    <link>http://blog.kineticweb.com/articles/2007/07/21/css-with-erb</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>Musings from a Ruby on Rails development team</description>
    <item>
      <title>CSS with ERB</title>
      <description>&lt;p&gt;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 &lt;a href="http://blog.hasmanythrough.com/2006/03/23/dirt-simple-rcss-templates"&gt;this one&lt;/a&gt; the best. (Note the blog name is a coincidence.)&lt;/p&gt;


	&lt;p&gt;I had to modify the suggested route slightly as this article is fairly outdated and doesn&amp;#8217;t work with the latest rails version that considers dot a separator in routes. So I used this:&lt;/p&gt;


&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_ruby "&gt;&lt;span class="ident"&gt;map&lt;/span&gt;&lt;span class="punct"&gt;.&lt;/span&gt;&lt;span class="ident"&gt;connect&lt;/span&gt; &lt;span class="punct"&gt;'&lt;/span&gt;&lt;span class="string"&gt;stylesheets/:rcss.:format&lt;/span&gt;&lt;span class="punct"&gt;',&lt;/span&gt; &lt;span class="symbol"&gt;:controller&lt;/span&gt; &lt;span class="punct"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="punct"&gt;'&lt;/span&gt;&lt;span class="string"&gt;stylesheets&lt;/span&gt;&lt;span class="punct"&gt;',&lt;/span&gt; &lt;span class="symbol"&gt;:action&lt;/span&gt; &lt;span class="punct"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="punct"&gt;'&lt;/span&gt;&lt;span class="string"&gt;rcss&lt;/span&gt;&lt;span class="punct"&gt;'&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

	&lt;p&gt;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&amp;#8217;ll do just that.&lt;/p&gt;


	&lt;p&gt;Speaking of color hex codes, &lt;a href="http://flickr.com/photos/jeremyjohnson/847449633/"&gt;this car license plate&lt;/a&gt; is pretty funny.&lt;/p&gt;</description>
      <pubDate>Sat, 21 Jul 2007 17:17:00 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:a0e5cd37-55be-42b5-82a4-99248935e846</guid>
      <author>Colin A. Bartlett</author>
      <link>http://blog.kineticweb.com/articles/2007/07/21/css-with-erb</link>
      <category>CSS</category>
      <category>Rails</category>
      <trackback:ping>http://blog.kineticweb.com/articles/trackback/47</trackback:ping>
    </item>
    <item>
      <title>"CSS with ERB" by Colin</title>
      <description>I'll definitely try out this SASS!

I started converting all my templates on an internal project to HAML a few months back. But it got sidelined. I really liked it though. Very clean and elegant.</description>
      <pubDate>Thu, 26 Jul 2007 07:08:39 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:5c65b2b7-f9ec-4d19-9199-0aa59fa239af</guid>
      <link>http://blog.kineticweb.com/articles/2007/07/21/css-with-erb#comment-84</link>
    </item>
    <item>
      <title>"CSS with ERB" by Mat Schaffer</title>
      <description>Don't forget SASS :)&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://haml.hamptoncatlin.com/docs/sass" rel="nofollow"&gt;http://haml.hamptoncatlin.com/docs/sass&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
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.</description>
      <pubDate>Tue, 24 Jul 2007 09:49:35 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:700da096-2b4f-49ab-8dc1-7cdfe73655b1</guid>
      <link>http://blog.kineticweb.com/articles/2007/07/21/css-with-erb#comment-83</link>
    </item>
  </channel>
</rss>
