翻译自sass官方文档: http://sass-lang.com/documentation/file.sass_reference.html#comments
sass 支持标准的css多行注释以 /* */以及单行注释 //。在尽可能的情况下,多行注释会被保留在输出的css中,而单行注释会被删除。 例如:
/* this comment is * several lines long. * since it uses the css comment syntax, * it will appear in the css output. */body { color: black; }// these comments are only one line long each.// they won't appear in the css output,// since they use the single-line comment syntax.a { color: green; }
编译为:
/* this comment is * several lines long. * since it uses the css comment syntax, * it will appear in the css output. */body { color: black; }a { color: green; }
如果多行注释的第一个字母是 !,那么注释总是会被保留到输出的css中,即使在压缩输出模式下。这可用于在你生成的css中添加版权声明。
使用插值语句 (interpolation) ,可以将变量值输出到多行注释中,例如:
$version: 1.2.3;/* this css is generated by my snazzy framework version #{$version}. */
编译为:
/* this css is generated by my snazzy framework version 1.2.3. */