Created
September 2, 2009 16:34
-
-
Save ambethia/179812 to your computer and use it in GitHub Desktop.
css2sass, but in the browser. Perfect for copy/pasting little snippets.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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