Book Image

Sass and Compass for Designers

By : Ben Frain
Book Image

Sass and Compass for Designers

By: Ben Frain

Overview of this book

Table of Contents (17 chapters)
Sass and Compass for Designers
Credits
Foreword
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Sass comment formats


There are two different ways to add comments into Sass files.

Standard CSS comments

As any standard CSS file is also a valid Sas(.scss) file, it stands to reason we can comment as we would in standard CSS:

/* Here is a normal CSS comment */

Remember, using this format alongside the compressed output option will mean that the comment is removed from the resultant CSS. However, if not using the compressed option, the comment will be retained in the CSS.

Sass single line comments

Sass also allows the use of a double forward slash to define the beginning of a single line comment. This is the same manner in which JavaScript files can be commented; anything written after the double forward slash on the same line becomes a comment. Here's an example from the variable file we just made:

$color9: #FF00FF; // Magenta

Here the comment has been added after a variable has been defined. However it could also be used at the beginning of a line. For example:

// Here is a Sass only comment 

No...