Skip to content

Instantly share code, notes, and snippets.

@rstacruz
Created October 13, 2010 05:22
Show Gist options
  • Select an option

  • Save rstacruz/623496 to your computer and use it in GitHub Desktop.

Select an option

Save rstacruz/623496 to your computer and use it in GitHub Desktop.
# Can't wait for Sinatra 1.1 for SCSS support?
# Just `require` this in your bootstrapper, somewhere right
# after require 'sinatra/base' or something.
# More about SCSS in sass-lang.com.
# lib/tilt_scss.rb
module Tilt
class ScssTemplate < SassTemplate
private
def sass_options
super.merge(:syntax => :scss)
end
end
register 'scss', ScssTemplate
end
class Main
helpers do
def scss(template, options={}, locals={})
options[:layout] = false
options.merge!(:line_numbers => true, :debug_info => true, :always_check => true) if settings.development?
render :scss, template, options, locals
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment