Commenting your code in the SCSS syntax
Commenting your code will help you and others to better understand the code. Comments can also be used by other tools. If you or someone else has to change your code, maybe after a long period since the code has been written, comments should make clear what a block of code does and why it has been added in the first place.
Getting ready
For this recipe, you will only have to install Ruby Sass. The Installing Sass for command line usage recipe of Chapter 1, Getting Started with Sass, explains how you can install Ruby Sass.
How to do it...
Perform the following step to find out the differences between the three types of comments supported by Sass:
- Create a Sass template called
comments.scss
. In this file, write down the SCSS code as follows:// start comments $author: 'Bass Jobsen'; // scss-lint:disable Comment /*! * Copyright 2015 #{$author} */ // scss-lint:disable PropertySpelling //compilles into invalid CSS .code { author: $author; } ...