Skip to content

Instantly share code, notes, and snippets.

@bts
Created August 22, 2010 06:30
Show Gist options
  • Save bts/543423 to your computer and use it in GitHub Desktop.
Save bts/543423 to your computer and use it in GitHub Desktop.
require 'sass'
configure do
Tilt.register 'scss', Tilt::SassTemplate
set :scss, :syntax => :scss
end
get '/stylesheets/:file.css' do |file|
content_type 'text/css', :charset => 'utf-8'
# no #scss method is defined (and #sass only looks for .sass files)
# we must call render ourself:
render :scss, file.to_sym, :layout => false, :views => './public/stylesheets'
end
require 'sass/plugin/rack'
Sass::Plugin.options[:template_location] = 'public/stylesheets'
use Sass::Plugin::Rack
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment