简体   繁体   中英

Set sass options in Rails 4.1.4

I'm trying to change the behavior of sass in Rails application but with no effect. Here is a summary what I did so far.

I've added

  config.sass.style = :compressed

in config/application.rb then restarted the server but no effect. After that I decided to try with config/environments/development.rb but same.

So my question is how to change sass options?

Try creating a file in config/initializers ie config/initializers/sass_options.rb then add the following in the file:

require 'sass/plugin'    
Sass::Plugin.options[:style] = :compressed

Restart the server and do a new try

Edit:

Are you using sass-rails gem? If you are running in development mode it looks like is hard-coded to 'expanded' https://github.com/rails/sass-rails/blob/master/README.md

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM