Search code examples
rubysasscompass-sasstilt

Using Tilt to render Sass template with Compass


I am working on a static site generator (Staticpress) that uses Tilt to handle rendering. Out of the box, Tilt can render sass just fine; however when I render a sass template that tries to @import compass/reset/utilities, Sass raises a Sass::SyntaxError. I can pass extra options to Tilt when I call #render (which will be passed on to Sass), but what options should I pass to make Compass available?

Update:

I have a one-line test file that only has @import "compass/reset/utilities" in it. The error I get when running my test is Sass::SyntaxError: File to import not found or unreadable: compass/reset/utilities, along with a stack trace.


Solution

  • I figured it out. Tilt has a way to pass options through to the rendering engine. To use Compass, pass Compass.sass_engine_options to Tilt.new.