How to tweak one color value?


#1

Scenario: I’m new to Atom, but find it very promising. I’m basically happy with the default dark theme, but would like comments in code to stand out more. Some brighter color.
I’ve been reading for a bit, but I’m apparently not googling the correct terms.

Question: Is it really true that in order to make comments purple (i.e., change one color value) I have to learn how to create/fork themes? That feels a little like rebuilding the kernel to increase the font size.

Thanks,
Ken


#2

There’s the styles.less file in ~/.atom in which you can customize themes. To customize the text color of comments you can put this in it:

atom-text-editor::shadow .comments {
  color: purple;
}

#3

I think installed themes have a higher specificity, so i would edit your theme directly.
You can do this by going into settings > themes and clicking on your syntax theme general area(if you click on title you open a webpage).
Click view code tab which will open a new window. Look in styles folder,
probably base.less and change styles there. Seem to have to restart atom
after saving to take effect.


#4

There’s no inherent specificity benefit to installed themes. @olmokramer’s advice is correct, you can add style rules to your styles.less to customize the appearance of anything in Atom. It breaks down like this:

  • styles.less
    • :+1: One command to open the one file needed
    • :+1: Not overwritten on theme updates
    • :+1: Automatically reloaded on save
  • Hand-editing theme
    • :-1: Multiple steps to edit, unclear which file to change
    • :-1: Changes are overwritten when theme is updated
    • :-1: Must restart Atom for changes to take effect

#5

Another: if you have the opportunity to make a change through a user file or by editing a package, and that change has unintended effects, it’s easier for others to help troubleshoot your issue if your package’s code is the same as everyone else’s, and it’s the styles.less, init.coffee, or config.cson that needs to be tweaked.