Skip to main content

Sass Comments

Comments are non-executable statements, which are placed in source code. Comments make source code easier to understand. SASS supports two types of comments.

  • Multiline comments − These are written using / and /. Multiline comments are preserved in CSS output.
  • Single line comments − These are written using // followed by comments. Single line comments are not preserved in CSS output.

Example

This is the style.scss file

/* This comment is
* more than one line long
* since it uses the CSS comment syntax,
* it will appear in the CSS output. */
body { color: black; }

// These comments are in single line
// They will not appear in the CSS output,
// since they use the single-line comment syntax.
a { color: blue; }

and this is the generated style.css file

/* This comment is
* more than one line long
* since it uses the CSS comment syntax,
* it will appear in the CSS output. */
body { color: black; }

a { color: blue; }
note

Comments in single line will not appear in the CSS output

Interpolation in Multiline Comments

Interpolation within the multiline comments are resolved in the resulting CSS.

So, you can specify variables or property names within the curly braces.

For example:

The style.scss

$version:  "7.8";  
/* Framework version for the generated CSS is #{$version}. */

will be converted to style.css

/* Framework version for the generated CSS is 7.8. */