tags:

views:

1212

answers:

3

I'm looking into ways to use SASS (Syntactically Awesome StyleSheets) from the Ruby HAML package in an ASP.NET environment. Ideally, I would like compilation of SASS files into CSS to be a seamless part of the build process.

What are the best ways to this integration? Alternatively, are there other CSS-generation tools that are better suited for a .NET environment?

+6  A: 

The compass project has a compiler that will compile your sass to css. It's built to run on windows, but it is not well tested on that platform. If you find any platform related bugs, I'll gladly help you fix them.

Compass can be found here: http://github.com/chriseppsein/compass

chriseppstein
Great job with compass , looks really awesome.
Surya
Thanks for the answer — I'll look into this tomorrow
Guðmundur H
+3  A: 

Its not SASS but you could take a look at our Less Css for .NET port. Compass looks really interesting though, and I think something like this for Less would be a great addition.

Owen
+1  A: 

I originally answered this question here.

#PostBuild.rb
#from http://sentia.com.au/2008/08/sassing-a-net-application.html
#Post-build event command line: rake -f "$(ProjectDir)PostBuild.rb"

require 'haml'
require 'sass'

task :default => [ :stylesheets ]

desc 'Regenerates all sass templates.'
task :stylesheets do
 wd = File.dirname(__FILE__)
 sass_root = File.join(wd, 'Stylesheets')
 css_root = File.join(wd, 'Content')
 Dir[sass_root + '/*.sass'].each do |sass|
  css = File.join(css_root, File.basename(sass, '.sass') + '.css')
  puts "Sassing #{sass} to #{css}."
  File.open(css, 'w') do |f|
   f.write(Sass::Engine.new(IO.read(sass)).render)
  end
 end
end
Justice