Css 如何仅发表sass评论

Css 如何仅发表sass评论,css,sass,Css,Sass,是否有办法在sass中仅对sass进行注释?你知道,所以输出的.css文件没有这些注释 比如说, /* global variables */ $mainColor: #666; /* Layout */ body {...} 将输出 /* global variables */ /* Layout */ body {...} 单行注释不会包含在编译的css中,使用// // This comment will not be included // in the compiled cs

是否有办法在
sass
中仅对
sass
进行注释?你知道,所以输出的
.css
文件没有这些注释

比如说,

/* global variables */

$mainColor: #666;

/* Layout */
body {...}
将输出

/* global variables */
/* Layout */
body {...}

单行注释不会包含在编译的css中,使用//

// This comment will not be included 
// in the compiled css!

< P>有三种选择供你考虑。

1) 使用以
/
开头的单行注释,就像已经建议的heylookltsme一样:

// This comment will not be included 
// in the compiled css!
2) 使用压缩文件编译SASS。然后传统的
/**/注释不会进入CSS

使用不同的输出样式进行编译可以通过香草SASS完成,但我也建议尝试一下

请注意,您可以覆盖输出样式,并通过以感叹号开头,强制注释始终显示在生成的CSS代码中:

/*!I really want this to appear in CSS at all times.*/
3) 使用Compass,您可以使SASS忽略所有注释:
/…
/**/。我已经在这个答案中解释了如何做到这一点:

你应该有一个很好的理由这么做