Does SCSS support inline comments?

前端 未结 2 777
花落未央
花落未央 2020-12-04 21:29

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

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

I don\'t want

相关标签:
2条回答
  • 2020-12-04 21:45

    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.

      • Except for some compressed modes, unless you start the comment with a !. See http://sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html#comments.

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

    0 讨论(0)
  • 2020-12-04 21:52

    Yes, you can do it in SCSS.

    Use inline comment: //.

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

    0 讨论(0)
提交回复
热议问题