Does SCSS support inline comments?

2019-01-13 09:23发布

Can I keep an inline comment like this in my .scss file

thead {
    display: table-header-group; // h5bp.com/t
}

I don't want this comment in my CSS output.

标签: css sass
2条回答
乱世女痞
2楼-- · 2019-01-13 10:10

Yes, you can do it in SCSS.

Use inline comment: //.

The single-line comments are removed in the CSS output.

查看更多
放荡不羁爱自由
3楼-- · 2019-01-13 10:15

There are two different types of comments to consider in SASS.

  1. Single line comments // will be removed by the .scss pre-procesor, and won't appear in your .css file.
  2. Multiline comments */ are valid CSS, and will be preserved* between the translation from .scss to your .css file.

It sounds like inline comments // are what you're looking for.

查看更多
登录 后发表回答