views:

43

answers:

3
#foo {
color:black; }

Is there some sort of option to prefix a newline before the trailing } when a .css file is generated from .sass?

I would appreciate it if someone included an example of combining sass --watch style.scss:style.css, which is what I'm using, along with this newline requirement.

A: 

Try running your generated files through CSSTidy. CSSTidy has plenty of options.

Alternately, you could do a simple find/replace using grep and sed if you're using a UNIX-like system. Here's a good guide to using the tools.

Just Jake
+1  A: 

You can set the style to expanded: http://sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html#output_style

igorw
If I'm not using Rails, where would I specify this? In some ~/.sass config?
meder
As described here: http://sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html#options you can pass the options into the constructor of Sass::Engine. Examples for it can also be found on that page.
igorw
Right, but it says Rack or Rails and I'm using neither.
meder
"…or by passing an options hash to Sass::Engine#initialize." http://sass-lang.com/docs/yardoc/Sass/Engine.html#initialize-instance_method http://sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html#using_sass "Using Sass in Ruby code is very simple. After installing the Haml gem, you can use it by running require "sass" and using Sass::Engine like so" (etc.)
igorw
+2  A: 

You can pass a --style parameter to specify what you want. I think you want the "expanded" style:

sass --watch style.scss:style.css --style expanded

See the Sass documentation for different output styles.

Andrew Vit