Skip to content

Instantly share code, notes, and snippets.

@ambethia
Created September 2, 2009 16:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ambethia/179812 to your computer and use it in GitHub Desktop.
Save ambethia/179812 to your computer and use it in GitHub Desktop.
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