How to define colours to syntax defined in grammars?


#1

Atom.io provides a guide how to create a grammar as in here:
https://flight-manual.atom.io/hacking-atom/sections/creating-a-grammar/#platform-mac

But they do not say anything how to define the colours for defined syntaxes (say a keyword). How do we define those?


#2

Grammars don’t define the colours

See making a syntax theme
https://flight-manual.atom.io/hacking-atom/sections/creating-a-theme/#creating-a-syntax-theme

I also suggest looking at exisitng syntax themes for examples
E.g.


#3

What about markdown rendering? I mean when you press ctrl+shift+m; for example say you want to change the colour of # headings…


#4

You could look at the package source, or use dev tools to see the selectors. That’s just general CSS though, so it’s not going to be covered in an Atom guide.