Modify the output style of sass

1.nested (nested indent, the default style)

#main p {
  color: #00ff00;
  width: 97%; }
  #main p .red {
    background-color: #ff0000;
    color: #000000; }
  #main p .blue {
    background-color: #2ebcff;
    color: #878787; }

2.expanded (swing, no indentation)

#main p {
  color: #00ff00;
  width: 97%;
}
#main p .red {
  background-color: #ff0000;
  color: #000000;
}
#main p .blue {
  background-color: #2ebcff;
  color: #878787;
}

3.compact (compact, one-way)

#main p { color: #00ff00; width: 97%; }
#main p .red { background-color: #ff0000; color: #000000; }
#main p .blue { background-color: #2ebcff; color: #878787; }

4.compressed (compression, no spaces and line breaks)

#main p{color:#00ff00;width:97%}#main p .red{background-color:#ff0000;color:#000000}

Roughly Road King:

D:\Software\Ruby22\Ruby24-x64\lib\ruby\gems\2.4.0\gems\sass-3.5.6\lib\sass

Locate and open with a compiler engine.rb

Probably in the 167 line;

DEFAULT_OPTIONS = {
      : Style =>: Compact ,   // modify Here, the output style you want to fill in here
      :load_paths => [],
      :cache => true,
      : Cache_location => './.sass-cache'
      :syntax => :sass,
      :filesystem_importer => Sass::Importers::Filesystem
    }.freeze

Reference to: https://www.cnblogs.com/xiaojianwei/p/10501609.html

Guess you like

Origin www.cnblogs.com/ruilin/p/11165729.html