3Commenting

Well-commented code is essential for any project. From a team of just one all the way to a team of hundreds, comments help outline what code is supposed to do.

A comment is like an aside in your code—it can explain goals, indicate bug fixes, or just let someone know how you’re using a particularly novel bit of code. And don’t think that a solo project doesn’t need comments! Some of the most valuable comments in our code are from our past selves.

Sass has two types of comment style. One is kept intact during compilation, so it appears in your CSS output. It’s a multiline comment style, and you place all your comments between /* and */. This can be useful for versioning your CSS file or indicating the date it was compiled.

You ...

Get Pragmatic Guide to Sass 3 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.