Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does SCSS support inline comments?

Tags:

css

sass

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.

like image 851
Jitendra Vyas Avatar asked Nov 13 '12 05:11

Jitendra Vyas


People also ask

How do I comment out a line in SCSS?

In SCSS permalinkIn SCSS Single-line comments start with // , and go until the end of the line. Nothing in a single-line comment is emitted as CSS; as far as Sass is concerned, they may as well not exist. They're also called silent comments, because they don't produce any CSS.

Is it better to use CSS or SCSS?

SCSS contains all the features of CSS and contains more features that are not present in CSS which makes it a good choice for developers to use it. SCSS is full of advanced features. SCSS offers variables, you can shorten your code by using variables. It is a great advantage over conventional CSS.


1 Answers

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.

like image 195
KatieK Avatar answered Oct 08 '22 00:10

KatieK