<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Cory O&#039;Daniel - These are just words &#187; sass</title>
	<atom:link href="http://coryodaniel.com/index.php/tag/sass/feed/" rel="self" type="application/rss+xml" />
	<link>http://coryodaniel.com</link>
	<description>Software development, thoughts, and randomness</description>
	<lastBuildDate>Thu, 17 Nov 2011 21:18:05 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Padrino, Compass, and Sass &#8211; Working happily via Ian Serlin</title>
		<link>http://coryodaniel.com/index.php/2010/04/17/padrino-compass-and-sass-working-happily-via-ian-serlin/</link>
		<comments>http://coryodaniel.com/index.php/2010/04/17/padrino-compass-and-sass-working-happily-via-ian-serlin/#comments</comments>
		<pubDate>Sat, 17 Apr 2010 22:22:59 +0000</pubDate>
		<dc:creator>Cory O'Daniel</dc:creator>
				<category><![CDATA[RubyDevelopment]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[compass]]></category>
		<category><![CDATA[padrino]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[sass]]></category>
		<category><![CDATA[sinatra]]></category>

		<guid isPermaLink="false">http://coryodaniel.com/?p=500</guid>
		<description><![CDATA[My cohort, Ian Serlin, discovered this.  In a project we are working on we could get Compass to play well with PadrinoRb.  It seems like the #sass method doesn't care about the options being passed to it, and we kept getting stack traces rendered into our CSS files. The stack trace was ruby [...]]]></description>
			<content:encoded><![CDATA[<p>My cohort, Ian Serlin, discovered this.  In a project we are working on we could get Compass to play well with PadrinoRb.  It seems like the #sass method doesn't care about the options being passed to it, and we kept getting stack traces rendered into our CSS files. The stack trace was ruby looking for - and failing to find compass/reset.css.</p>
<p>This is the code that DOESN'T work (padrino 0.9.10, compass 0.8.17, sinatra 1.0).</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
</pre></td><td class="code"><pre class="ruby" style="font-family:monospace;">  configure <span style="color:#9966CC; font-weight:bold;">do</span>
    register SassInitializer <span style="color:#008000; font-style:italic;">#The Rack Sass reloader...</span>
&nbsp;
    Compass.<span style="color:#9900CC;">configuration</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>config<span style="color:#006600; font-weight:bold;">|</span>
      config.<span style="color:#9900CC;">project_path</span> = <span style="color:#CC00FF; font-weight:bold;">File</span>.<span style="color:#9900CC;">dirname</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF; font-weight:bold;">__FILE__</span><span style="color:#006600; font-weight:bold;">&#41;</span>
      config.<span style="color:#9900CC;">sass_dir</span> = <span style="color:#996600;">&quot;stylesheets&quot;</span>
      config.<span style="color:#9900CC;">project_type</span> = <span style="color:#ff3333; font-weight:bold;">:stand_alone</span>
      config.<span style="color:#9900CC;">http_path</span> = <span style="color:#996600;">&quot;/&quot;</span>
      config.<span style="color:#9900CC;">css_dir</span> = <span style="color:#996600;">&quot;stylesheets&quot;</span>
      config.<span style="color:#9900CC;">images_dir</span> = <span style="color:#996600;">&quot;images&quot;</span>
      config.<span style="color:#9900CC;">output_style</span> = <span style="color:#ff3333; font-weight:bold;">:compressed</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>   
  get <span style="color:#996600;">'/stylesheets/:file.css'</span> <span style="color:#9966CC; font-weight:bold;">do</span>
    content_type <span style="color:#996600;">'text/css'</span>, <span style="color:#ff3333; font-weight:bold;">:charset</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">'utf-8'</span>
    <span style="color:#008000; font-style:italic;"># This is the doc on how to give Sass some more load paths to find the compass  files. </span>
    <span style="color:#008000; font-style:italic;">#   it doesnt work :P and for that matter, neither does:</span>
    <span style="color:#008000; font-style:italic;"># sass :file, Compass.sass_engine_options</span>
    <span style="color:#008000; font-style:italic;"># or the set :sass, whatever_hash_here</span>
    sass <span style="color:#ff3333; font-weight:bold;">:file</span>, <span style="color:#ff3333; font-weight:bold;">:sass</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> Compass.<span style="color:#9900CC;">sass_engine_options</span>
  <span style="color:#9966CC; font-weight:bold;">end</span></pre></td></tr></table></div>

<p>Our solution was to force Sass options and Compass options to merge...</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
</pre></td><td class="code"><pre class="ruby" style="font-family:monospace;">  configure <span style="color:#9966CC; font-weight:bold;">do</span>
    register SassInitializer
&nbsp;
    Compass.<span style="color:#9900CC;">configuration</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>config<span style="color:#006600; font-weight:bold;">|</span>
      config.<span style="color:#9900CC;">project_path</span> = <span style="color:#CC00FF; font-weight:bold;">File</span>.<span style="color:#9900CC;">dirname</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF; font-weight:bold;">__FILE__</span><span style="color:#006600; font-weight:bold;">&#41;</span>
      config.<span style="color:#9900CC;">sass_dir</span> = <span style="color:#996600;">&quot;stylesheets&quot;</span>
      config.<span style="color:#9900CC;">project_type</span> = <span style="color:#ff3333; font-weight:bold;">:stand_alone</span>
      config.<span style="color:#9900CC;">http_path</span> = <span style="color:#996600;">&quot;/&quot;</span>
      config.<span style="color:#9900CC;">css_dir</span> = <span style="color:#996600;">&quot;stylesheets&quot;</span>
      config.<span style="color:#9900CC;">images_dir</span> = <span style="color:#996600;">&quot;images&quot;</span>
      config.<span style="color:#9900CC;">output_style</span> = <span style="color:#ff3333; font-weight:bold;">:compressed</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
    <span style="color:#6666ff; font-weight:bold;">Sass::Plugin</span>.<span style="color:#9900CC;">options</span>.<span style="color:#9900CC;">merge</span>!<span style="color:#006600; font-weight:bold;">&#40;</span>Compass.<span style="color:#9900CC;">sass_engine_options</span><span style="color:#006600; font-weight:bold;">&#41;</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
  get <span style="color:#996600;">'/stylesheets/:file.css'</span> <span style="color:#9966CC; font-weight:bold;">do</span>
    content_type <span style="color:#996600;">'text/css'</span>, <span style="color:#ff3333; font-weight:bold;">:charset</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">'utf-8'</span>
    sass <span style="color:#ff3333; font-weight:bold;">:file</span>
  <span style="color:#9966CC; font-weight:bold;">end</span></pre></td></tr></table></div>

<p>Yay, magic spells - it works. You can check out more ian magic spells at ianserlin.com.</p>
<p align="left"><a class="tt" href="http://twitter.com/home/?status=Padrino%2C+Compass%2C+and+Sass+%E2%80%93+Working+happily+via+Ian+Serlin+http://bit.ly/cdI2jj" title="Post to Twitter"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-twitter-big2.png" alt="Post to Twitter" /></a> <a class="tt" href="http://digg.com/submit?url=http://coryodaniel.com/index.php/2010/04/17/padrino-compass-and-sass-working-happily-via-ian-serlin/&amp;title=Padrino%2C+Compass%2C+and+Sass+%E2%80%93+Working+happily+via+Ian+Serlin" title="Post to Digg"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-digg-big2.png" alt="Post to Digg" /></a> <a class="tt" href="http://www.facebook.com/share.php?u=http://coryodaniel.com/index.php/2010/04/17/padrino-compass-and-sass-working-happily-via-ian-serlin/&amp;t=Padrino%2C+Compass%2C+and+Sass+%E2%80%93+Working+happily+via+Ian+Serlin" title="Post to Facebook"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-facebook-big2.png" alt="Post to Facebook" /></a> <a class="tt" href="http://reddit.com/submit?url=http://coryodaniel.com/index.php/2010/04/17/padrino-compass-and-sass-working-happily-via-ian-serlin/&amp;title=Padrino%2C+Compass%2C+and+Sass+%E2%80%93+Working+happily+via+Ian+Serlin" title="Post to Reddit"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-reddit-big2.png" alt="Post to Reddit" /></a> <a class="tt" href="http://stumbleupon.com/submit?url=http://coryodaniel.com/index.php/2010/04/17/padrino-compass-and-sass-working-happily-via-ian-serlin/&amp;title=Padrino%2C+Compass%2C+and+Sass+%E2%80%93+Working+happily+via+Ian+Serlin" title="Post to StumbleUpon"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-su-big2.png" alt="Post to StumbleUpon" /></a></p>]]></content:encoded>
			<wfw:commentRss>http://coryodaniel.com/index.php/2010/04/17/padrino-compass-and-sass-working-happily-via-ian-serlin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

