5

I'm new to Atom and I was wondering if we could customize the comment styles that come with the One Dark Syntax Theme via the style.less (Atom > Stylesheet...) file. I looked up the source code for the theme and in the language.less file I found this:

.comment {
color: @mono-3;
font-style: italic;

.markup.link {
color: @mono-3;
  }
}

Specifically, I would like to change to font-style to normal but I can't seem to find a way, please help. Thanks.

1
  • In Notepad++, all I have to do is go to Settings > Style Configurator > Language > COMMENTLINE > Pick a color > Save. Commented Aug 3, 2018 at 18:26

3 Answers 3

9

You shouldn't use atom-text-editor::shadow any more

enter image description here

You should now use

atom-text-editor.editor .syntax--comment {
  font-style: normal;
}
Sign up to request clarification or add additional context in comments.

Comments

3

[Update]

Atom has changed and the accepted answer is now the one you should use!

[Old Answer]

The elements you're trying to target are inside the text editor element's shadow DOM; try

atom-text-editor::shadow .comment {
  font-style: normal;
}

3 Comments

Would you mind telling me how I can arrive at this answer?
Some of it requires being familiar with the shadow DOM and how to style it. But there's a quick example under "Style Tweaks" in the Atom Flight Manual customization page.
Atom rules has been updated, and this one in particular has been replaced. atom-text-editor::shadow .comment -> atom-text-editor.editor .syntax--comment
0

Specifically, you would want to change your example to

.editor, atom-text-editor::shadow {
  .comment {
    font-style: normal;
  }
}

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.