Does SCSS support inline comments?
There are two different types of comments to consider in SASS.
- Single line comments
//
will be removed by the .scss pre-procesor, and won't appear in your .css file. Multiline comments
*/
are valid CSS, and will be preserved* between the translation from .scss to your .css file.- Except for some compressed modes, unless you start the comment with a
!
. See http://sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html#comments.
- Except for some compressed modes, unless you start the comment with a
It sounds like inline comments //
are what you're looking for.
wrong auto comments for scss in vscode
I believe this is working as expected, as SCSS supports both ways to comment, and I do not think there are any settings in Visual Studio Code you can change to change how the comment style works.
Ctrl + / is "Toggle Line Comment", which is the //
way. If you want to comment using the multi-line comment format, you can instead highlight what it is you want to comment, and perform Shift + Alt + A.
However, there is another way to change how the Line Comments work:
- Find where Visual Studio Code is installed on your system, and go to resources → app → extensions → scss
- In the scss folder should be a "language-configurations.json" file. Open it.
- Change the
lineComment
property to be either a blank string, or delete it outright.
"lineComment": ""
- Save the file, and restart Visual Studio Code. Now when you perform Ctrl + /, it should comment using the style you prefer.
How to ignore comments in sass partial files?
If you use inline comments, they won't show up in your compiled file.
For example:
// Colors
How to add comments to inline CSS?
Use /*
and */
.
<span class="color_dark" style="top:20px; /*font-size: 17px;*/ line-height: 0px;position: relative;">onbezorgd genieten van uw<br> haard of kachel</span>
You can see that Google Chrome uses those too when disabling a style on a page.
And google your question next time first please.
Related Topics
CSS Specificity or Inheritance
Implement a CSS-Only Slideshow/Carousel with Next and Previous Buttons
Css: Background Image Does Not Fill When Scrolling
CSS Select Multiple Descendants of Another Element
Internet Explorer "CSS Was Ignored Due to Mime Type Mismatch" on Local Files (No Server)
:Last-Child Pseudo-Class Mixed with Attribute Selector Not Working
How to Change Navbar Collapse Threshold Using Twitter Bootstrap-Responsive
Css: Bottom-Border-Transition - Expand from Middle
How to Define Specific CSS Rules for IE9 Alone
Pass Function or Mixin by Reference in SASS
What Is the Em Font-Size Unit? How Much Is It in Pixels
Slashes ('/') in CSS Values When Using Less (E.G. in 'Font' Shorthand)
Import CSS/Scss File into a Class
Bootstrap Navbar List Items/Links Not Showing
Change the Style of an Element If the Fragment Identifier (Hash) in the Url References It
How to Evenly Distribute Elements in a Div Next to Each Other