Skip to content

Instantly share code, notes, and snippets.

@coderek
Created September 30, 2013 05:47
Show Gist options
  • Save coderek/6759779 to your computer and use it in GitHub Desktop.
Save coderek/6759779 to your computer and use it in GitHub Desktop.
# download at https://github.com/nex3/sass/archive/stable.zip
# command to compile
# `jrubyc sass.rb`
# command to run
# `java -cp .:/path/to/jruby-complete-1.7.4.jar sass`
$:.unshift "D:\\sass-stable\\lib" # replace with your lib path
require "sass"
# for info of syntax http://sass-lang.com/
sass1 = <<EOS
$blue: #3bbfce
$margin: 16px
.content-navigation
border-color: $blue
color: darken($blue, 9%)
.border
padding: $margin / 2
margin: $margin / 2
border-color: $blue
EOS
puts "\n"
puts "================sass output======================"
puts "\n"
e1 = Sass::Engine.new(sass1, :syntax => :sass)
puts e1.render
scss1 = <<EOS
table.hl {
margin: 2em 0;
td.ln {
text-align: right;
}
}
li {
font: {
family: serif;
weight: bold;
size: 1.2em;
}
}
EOS
puts "\n"
puts "================scss output======================"
puts "\n"
e2 = Sass::Engine.new(scss1, :syntax => :scss)
puts e2.render
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment