I am compiling a SCSS file and it seems to remove my comments. What command can I use to keep all the comments?
>SASS input.scss output.css
I see two types of comments in my SCSS.
// Comment
and
/* Comment */
What is the difference?
I am compiling a SCSS file and it seems to remove my comments. What command can I use to keep all the comments?
>SASS input.scss output.css
I see two types of comments in my SCSS.
// Comment
and
/* Comment */
What is the difference?
As @Roy said above, multi-line comments (/* */) are kept in resulted css, but it depends on format you are using to pre-process your SASS.
If you are using compact mode, or any other 'CSS minifier', you should better use
/*! important comment */
These comments are kept in the compact(minified) versions of your CSS as well.
Example:
html {
/*! important comment */
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
Result (compact, minified version):
html{/*! important comment */-webkit-box-sizing:border-box;box-sizing:border-box}
The difference between the two type of comments is pretty easy:
and
According to the officials docs of SASS, you can only use the multiline comment option to preserve it into a compiled output file.
So the following CSS:
will be compiled into:
To fix your compilation problems, you need to convert the
//
to/* */
comments.