Now in the css and sass / scss files, the code is commented on with two slashes. How to change to a classic comment like / * comment * /?
1 answer
Commenting / uncommenting is wired into the Atom “core” and uses grammar (CSON files with parse rules for highlighting) of a specific language to figure out a way.
And generally, CSS has no one-line comments with // . Atom knows this and does not break. When the CSS grammar is enabled, Atom uses exactly the syntax /*комментарий*/ .
Sass and SCSS is another matter. There are single-line comments there, and solving this question by changing the grammar is not the case (it is possible and possible, but difficult and unreliable). There are packages that make a separate keyboard shortcut for "block comment". A block-comment package, for example, wraps the selection in a comment by Ctrl + Shift + / .
And as a "crutch" you can switch to CSS and comment out in it. Or even build a team that hangs on the same hot key and, working only in Sass / SCSS, switches to CSS, comments / uncomments and switches back.
- In fact, what is commented out in sass / scss (commented with just a double slash) does not get into the compiled css-file (checked). I was worried that IE did not understand such comments. And in the css files themselves, the comments are classic, just like / * comment * /. So here's a bit of carelessness on my part :) - Follower
- @Follower but, well, then they are preprocessors to add syntactic sugar :) But not all single-line comments are understood by all browsers so they are not in CSS. Where they are implemented, they are added to please someone else's bad habits: R - D-side