#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
It would be nice to port SASS to .NET, because it's such a nice tool and .NET is such a nice platform. But there's not really much need, because we can continue to use the Ruby tool as-is. You can very easily add a step to your build process which compiles SASS files into CSS files using the Ruby tool.
Here's mine.
#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
发布评论
评论(4)
http://www.dotlesscss.org/ - 我尝试使用 Less for .NET。
http://www.dotlesscss.org/ - My attempt at playing around with Less for .NET.
将 SASS 移植到 .NET 会很好,因为它是一个非常好的工具,而 .NET 也是一个非常好的平台。 但实际上并没有太大的必要,因为我们可以继续按原样使用 Ruby 工具。 您可以非常轻松地在构建过程中添加一个步骤,使用 Ruby 工具将 SASS 文件编译为 CSS 文件。
这是我的。
It would be nice to port SASS to .NET, because it's such a nice tool and .NET is such a nice platform. But there's not really much need, because we can continue to use the Ruby tool as-is. You can very easily add a step to your build process which compiles SASS files into CSS files using the Ruby tool.
Here's mine.
我用这个,很震撼!
必须阅读这些链接:
http://www.hanselman.com/blog/CoffeeScriptSassAndLESSSupportForVisualStudioAndASPNETWithTheMindscapeWebWorkbench.aspx
http://www.mindscapehq.com/products/web-workbench/getting-started
I use this, it rocks!
got to read these links:
http://www.hanselman.com/blog/CoffeeScriptSassAndLESSSupportForVisualStudioAndASPNETWithTheMindscapeWebWorkbench.aspx
http://www.mindscapehq.com/products/web-workbench/getting-started
CSS 变量可以通过 HTTP 处理程序来完成。
http:// www.webpronews.com/blogtalk/2006/10/16/add-variables-to-standard-css-stylesheets-in-aspnet
我想很多其他有用的功能都以某种形式存在,你是吗?具体有兴趣吗?
CSS Variables can be accomplished with HTTP Handlers.
http://www.webpronews.com/blogtalk/2006/10/16/add-variables-to-standard-css-stylesheets-in-aspnet
I imagine a lot of the other useful features exist in some form, which are you interested in specifically?