CSS SCSS 支持内联注释吗?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/13355989/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Does SCSS support inline comments?
提问by Jitendra Vyas
Can I keep an inline comment like this in my .scss
file
我可以在我的.scss
文件中保留这样的内联注释吗
thead {
display: table-header-group; // h5bp.com/t
}
I don't want this comment in my CSS output.
我不希望在我的 CSS 输出中出现此评论。
回答by KatieK
There are two different types of comments to consider in SASS.
在 SASS 中有两种不同类型的注释需要考虑。
- Single line comments
//
will be removed by the .scss pre-procesor, and won't appear in your .css file. Multiline comments
*/
are valid CSS, and will be preserved* between the translation from .scss to your .css file.- Except for some compressed modes, unless you start the comment with a
!
. See http://sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html#comments.
- Except for some compressed modes, unless you start the comment with a
- 单行注释
//
将被 .scss 预处理器删除,并且不会出现在您的 .css 文件中。 多行注释
*/
是有效的 CSS,将在从 .scss 到 .css 文件的翻译之间保留*。- 除了某些压缩模式,除非您以
!
. 请参阅http://sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html#comments。
- 除了某些压缩模式,除非您以
It sounds like inline comments //
are what you're looking for.
听起来//
您正在寻找内联注释。
回答by simhumileco
Yes, you can do it in SCSS.
是的,您可以在SCSS 中做到这一点。
Use inline comment: //
.
使用内联注释://
.
The single-line comments are removed in the CSS output.
在 CSS 输出中删除了单行注释。