nonopolarity
nonopolarity

Reputation: 150976

For Ruby on Rails, how do you tell Sass to compress the generated CSS?

The following is quite cool (running on Bash):

$ echo -e "div\n  color: #ffffee" | sass -t compressed 
div{color:#ffe}

as compared to:

$ echo -e "div\n  color: #ffffee" | sass 
div {
  color: #ffffee; }

so can the -t compressed option be used for a Rails project -- how can it be configured?

-t, --style NAME      Output style. Can be nested (default), compact, 
                        compressed, or expanded.

Upvotes: 1

Views: 1858

Answers (1)

Adam Albrecht
Adam Albrecht

Reputation: 6870

In your Environment.rb (or wherever you're setting your sass options), add the following:

Sass::Plugin.options[:style] = :compressed

See the sass documentation on style ouput here and general options here

Upvotes: 5

Related Questions