开发者

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

开发者 https://www.devze.com 2023-02-18 06:49 出处:网络
The following is quite cool (running on Bash): $ echo -e \"div\\ncolor: #ffffee\" | sass -t compressed

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

精彩评论

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

关注公众号