Sass comments come in silent (//) and loud (/* */) forms. This page covers both syntaxes, /*! important comments, interpolation, SassDoc /// docs, and five compiled examples.
01
Silent
// never in CSS
02
Loud
/* */ to CSS
03
Important
/*! */ kept
04
#{…}
In loud comments
05
SassDoc
/// docs
06
Practice
5 examples
Concept
What Are Sass Comments?
Official docs: both SCSS and the indented syntax support two comment styles—comments defined with /* */ that are (usually) compiled to CSS, and comments defined with // that are not.
Silent (//) — never appear in the CSS output.
Loud (/* */) — usually become CSS comments (removed in compressed mode).
Important (/*! */) — loud comments that survive compression.
Loud comments may contain interpolation that Sass evaluates first.
💡
Beginner tip
Prefer // for everyday notes about why a rule exists. Reach for /* */ only when someone reading the compiled CSS needs the note, and /*! */ for licenses that must stay after minification.
Foundation
📝 Syntax (SCSS)
In SCSS, comments work like JavaScript: // runs to the end of the line; /* … */ can span multiple lines. Both kinds can appear almost anywhere whitespace is allowed.
styles.scss
// This comment won't be included in the CSS.
/* But this comment will, except in compressed mode. */
/* It can also contain interpolation:
* 1 + 1 = #{1 + 1} */
/*! This comment will be included even in compressed mode. */
p /* Multi-line comments can be written anywhere
* whitespace is allowed. */ .sans {
font: Helvetica, // So can single-line comments.
sans-serif;
}
Compare
⚖️ Silent vs Loud Comments
Feature
// silent
/* */ loud
In CSS output?
Never
Yes (expanded / nested styles)
Compressed mode
Still absent
Stripped (unless /*!)
Interpolation
Not useful in output
Evaluated into the CSS comment
Best for
Author notes, TODOs
Notes for CSS readers, section banners
Production
⚡ Important Comments (/*!)
By default, multi-line comments are stripped from compressed CSS. If a comment begins with /*!, Sass keeps it in every output style—handy for copyright and license headers that must remain after minification.
Syntax Modes
📄 Comments in the Indented Syntax
Official docs: in .sass (indented) files, comments are indentation-based. Silent // comments never emit CSS, and everything indented beneath the opening // is also commented out. Loud /* comments work the same way with indentation; the closing */ is optional. Both still support interpolation and /*!. Inside expressions, comment syntax matches SCSS.
💡
Most tutorials use SCSS
The examples on this page use .scss. If you write indented Sass, remember that nested lines under // or /* are part of the comment block.
Libraries
📚 Documentation Comments (SassDoc)
When you ship a style library, document mixins, functions, variables, and placeholders with silent /// comments directly above the item. Tools such as SassDoc parse the text as Markdown and support annotations like @param and @return.
These are still silent comments—they never appear in CSS. They exist for humans and documentation generators.
Cheat Sheet
⚡ Quick Reference
Goal
Code
Silent note
// why this rule exists
Loud CSS comment
/* Section: buttons */
Keep after minify
/*! License text */
Interpolate in loud
/* v#{$version} */
Document an API
/// @param {Color} $brand
Inline silent
color: $brand; // brand token
Hands-On
Examples Gallery
Each example shows a core comment behavior. Open View Compiled CSS for verified output (expanded style unless noted).
📚 Getting Started
Official-style mix of silent, loud, important, and inline comments.
Example 1 — Official SCSS Comment Mix
Silent lines disappear; loud and important comments remain in expanded CSS.
styles.scss
// This comment won't be included in the CSS.
/* But this comment will, except in compressed mode. */
/* It can also contain interpolation:
* 1 + 1 = #{1 + 1} */
/*! This comment will be included even in compressed mode. */
p /* Multi-line comments can be written anywhere
* whitespace is allowed. */ .sans {
font: Helvetica, // So can single-line comments.
sans-serif;
}
📤 Compiled CSS:
/* But this comment will, except in compressed mode. */
/* It can also contain interpolation:
* 1 + 1 = 2 */
/*! This comment will be included even in compressed mode. */
p .sans {
font: Helvetica, sans-serif;
}
How It Works
The silent // notes vanish. Loud comments stay (with #{1 + 1} evaluated to 2). The selector comment is whitespace, so p .sans compiles cleanly.
Example 2 — Everyday Silent & Loud Notes
Use silent comments for authors; loud comments when the CSS file should keep a label.
Drop silent always; drop normal loud in compressed mode.
Filter
4
✓
CSS ships
Only surviving loud / important comments remain.
Watch Out
⚠️ Common Pitfalls
Expecting // in CSS — silent comments never compile out.
Assuming loud comments survive minify — use /*! for that.
Putting secrets in loud comments — they may ship to every visitor.
Forgetting indented blocks — in .sass, nested lines under // are also comments.
Mixing SassDoc with loud comments — use /// above APIs, not /* */.
Pro Tips
💡 Best Practices
✅ Do
Default to // for everyday author notes
Use /*! for licenses and required banners
Document public mixins/functions with ///
Explain why, not what the CSS already shows
Keep comments short and close to the code they describe
❌ Don’t
Leave outdated loud comments that confuse CSS readers
Rely on normal /* */ in production minified CSS
Comment out large dead blocks forever—delete or use version control
Put credentials or private URLs in any loud comment
Skip documenting library APIs your teammates consume
Summary
Key Takeaways
Knowledge Unlocked
Five things to remember about Sass comments
Silent, loud, important, interpolation, and SassDoc.
5
Core concepts
💬01
// silent
never in CSS
Basics
📝02
/* loud */
usually in CSS
Output
⚡03
/*! keep */
survives minify
Prod
🔢04
#{ }
in loud comments
Power
📚05
/// docs
SassDoc ready
Libs
❓ Frequently Asked Questions
Silent comments start with // and go to the end of the line. They are never emitted as CSS. In the indented .sass syntax, everything indented under // is also commented out.
Loud comments use /* */. When written where a statement is allowed, they compile to CSS comments. By default they are removed in compressed output.
A multi-line comment that begins with /*! is kept even in compressed mode. Use it for licenses, copyright notices, and other text that must ship in the CSS file.
Yes for loud /* */ comments. Expressions inside #{ } are evaluated before the comment is written to CSS. Silent // comments are not emitted, so interpolation there does not appear in output.
Documentation comments use three slashes (///) above mixins, functions, variables, or placeholders. SassDoc reads them as Markdown and can generate library docs.
The idea is the same, but indented syntax is indentation-based: blocks under // or /* are included in the comment, and */ is optional for loud comments. Inline expression comments match SCSS.
Did you know?
Loud comments are sometimes called that by contrast with silent comments—the official Sass docs use both nicknames so beginners can remember which ones “speak” in the CSS file.
Sass gives you silent // notes for authors, loud /* */ comments for CSS readers, and /*! when a banner must survive compression. Add /// when you document a library API.