开发者

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 proj开发者_高级运维ect -- how can it be configured?

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


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜