有没有办法发表sass-only评论SASS?您知道,因此输出.css文件没有这些注释
例如,
/* global variables */
$mainColor: #666;
/* Layout */
body {...}
Run Code Online (Sandbox Code Playgroud)
将输出
/* global variables */
/* Layout */
body {...}
Run Code Online (Sandbox Code Playgroud)
您可以考虑三种选择.
1)使用单行注释开头//,就像heylookltsme已经建议的那样:
// This comment will not be included
// in the compiled css!
Run Code Online (Sandbox Code Playgroud)
2)使用压缩 输出样式编译SASS .然后传统的/* ... */评论将不会进入CSS.
可以使用vanilla SASS进行不同输出样式的编译,但我也建议尝试使用Compass.
请注意,您可以覆盖输出样式并强制注释始终显示在生成的CSS代码中,方法是使用exclaimation标记:
/*!I really want this to appear in CSS at all times.*/
Run Code Online (Sandbox Code Playgroud)
3)使用Compass,您可以使SASS省略所有注释:both // ...和/* ... */.我在这个答案中解释了如何做到这一点:https://stackoverflow.com/a/15766439/901944
你应该有一个非常好的理由去那样做.
| 归档时间: |
|
| 查看次数: |
909 次 |
| 最近记录: |