25
#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.

meder omuraliev
  • 183,342
  • 71
  • 393
  • 434

3 Answers3

48

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
  • 18,961
  • 6
  • 77
  • 84
4

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

igorw
  • 27,759
  • 5
  • 78
  • 90
  • If I'm not using Rails, where would I specify this? In some ~/.sass config? – meder omuraliev Jul 01 '10 at 19:49
  • 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 Jul 01 '10 at 20:07
  • Right, but it says Rack or Rails and I'm using neither. – meder omuraliev Jul 01 '10 at 20:27
  • 1
    "…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 Jul 01 '10 at 21:25
0

I found the above solution to error in the terminal. If so, you can try the below which worked for me.

sass --watch scss:css --style expanded

Al-76
  • 1,738
  • 6
  • 22
  • 40