我有一个 SCSS 文件,如下所示
.seletor{
/* comment 1 */
.sub-selector{
}
/* comment 2 */
.sub-selector{
}
}
Run Code Online (Sandbox Code Playgroud)
当我编译它时,我得到了这个
.seletor {
font-size: 8px;}
/* comment 1 */
/* comment 2 */ }
.seletor .sub-selector {
font-size: 8px; }
.seletor .sub-selector {
font-size: 8px; }
Run Code Online (Sandbox Code Playgroud)
我想要得到的是
.seletor {
font-size: 8px;}
/* comment 1 */
.seletor .sub-selector {
font-size: 8px; }
/* comment 2 */
.seletor .sub-selector {
font-size: 8px; }
Run Code Online (Sandbox Code Playgroud)
所以注释必须是我在 scss 文件中写入的确切位置。我该如何实现这一目标?
不幸的是,这似乎不可能。我想知道为什么你希望评论这样输出?一般来说,sass 背后的强大功能是让您的工作文档可读,并压缩实际的最终产品。
一些参考:
如果您使用指南针,请查看line_comments
:
http ://compass-style.org/help/documentation/configuration-reference/
这会给你这样的输出:
/* line 1, sass/file.scss */
.selector { font-size: 8px; }
Run Code Online (Sandbox Code Playgroud)
否则,如果您需要注释工作文档,并且不希望它们出现在输出中的奇怪位置,请使用 // 而不是 /* */
归档时间: |
|
查看次数: |
441 次 |
最近记录: |