5Commenting

Comments are snippets of text that are ignored by the browser. Sass gives us the option of two types of comments. One will only show up in the Sass document, and the other will be incorporated into the CSS that’s compiled.

The comment style that’s compiled into the CSS is the same one you’re probably used to—in fact, it’s exactly the same as the CSS comment style. Just place your comment between /* and */. These comments can be on multiple lines.

If we want to write a comment that will only appear in the Sass file, then we place the comment after //. This style only works for single-line comments, though.

What To Do...
  • Use two different styles of comments.
    basics/comments.scss
     
    /* Hey look at this multiline comment
     
    * that we want ...

Get Pragmatic Guide to Sass now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.