Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to ignore comments in sass partial files?

Tags:

html

css

sass

I'm using SASS and I have partial file for variables: _variables.scss. Above some group of variables, I'm using a comments. For ex.

/* Colors */
$primary_red: #c02323;
$dark_red: #84000f;
$blue_bg: #007eb6;

When using partials, the code is ignored in the css file, but the comments are showing:

enter image description here

Is there any way how to prevent them to show?

like image 975
Milan Savov Avatar asked Jun 28 '16 07:06

Milan Savov


People also ask

What is silent comment in SASS?

Single-line comments start with // , and go until the end of the line. Nothing in a single-line comment is emitted as CSS; as far as Sass is concerned, they may as well not exist. They're also called silent comments, because they don't produce any CSS. Multi-line comments start with /* and end at the next */ .

Does SASS support inline comments?

SASS supports two types of comments. Multiline comments − These are written using /* and */. Multiline comments are preserved in CSS output. Single line comments − These are written using // followed by comments.

What is the difference between SCSS and SASS?

SASS (Syntactically Awesome Style Sheets) is a pre-processor scripting language that will be compiled or interpreted into CSS. SassScript is itself a scripting language whereas SCSS is the main syntax for the SASS which builds on top of the existing CSS syntax.

How many syntaxes that SASS support?

Sass consists of two syntaxes.


1 Answers

If you use inline comments, they won't show up in your compiled file.

For example:

// Colors
like image 194
ThomasM Avatar answered Oct 27 '22 00:10

ThomasM