Skip to content

Instantly share code, notes, and snippets.

@ambethia

ambethia/README

Created Sep 2, 2009
Embed
What would you like to do?
css2sass, but in the browser. Perfect for copy/pasting little snippets.
Try it like:
> curl http://gist.github.com/raw/179812/b4c828dec41437839dec8a74b2aff03227145ce2/sassy.rb | ruby
Actually... damn that doesn't work. :( I'll figure it out later.
require 'sinatra'
require 'haml'
require 'sass/css'
get '/' do
haml :index
end
post '/' do
@sass = Sass::CSS.new(params[:css]).render
haml "%pre= @sass"
end
__END__
@@ layout
%html
%head
%title Sassy!
%body
= yield
@@ index
%form(action="/" method="POST")
%textarea(name="css" cols="80" rows="50") /* Paste some CSS here to convert to SASS */
%br
%input(type="submit" value="Sass-ify!")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment