Search code examples
lesseditorcustomizationsyntax-highlightingatom-editor

How to change color of comment marker for Atom editor?


I was able to change color of comment content with

atom-text-editor::shadow .comment {
  color: #E4F4FD;
}

But the color of comment marker stayed unchanged:

enter image description here

How do I change the color of comment marker?


Solution

  • If you place your cursor immediately to the left of the character you want to style and then press Ctrl-Alt-Shift-P all of the scopes for that character will be displayed in an information box:

    Screenshot of Scopes at Cursor

    You can then incorporate this into your stylesheet as you have with the body of the comment:

    atom-text-editor::shadow {
      .comment {
        color: #E4F4FD;
      }
    
      .punctuation.definition.comment {
        color: #E4F4FD;
      }
    }
    

    Because it is LESS, it is possible to nest classes which will make your style sheet much cleaner.