Creating Themes: Any documentation on not-common "Scopes"?

Hi all!

I’m trying to build a custom theme, downloaded the Sample files + Markdown Syntax to compare and started making some adjustments.

One thing made this experience bit tedious, trying to know what exactly each “scope” changes? Is there a documentation for it or a way i could find some references for it?

For now these are mainly what interest me:

  1. text.[weight/style].[size]: How/when those combinations happen? I thought for example if my heading01 is Large & bold – this will apply, but it doesn’t.
  2. text.monospace.[sizes]: How/when a text is a monospace so this applies? (not a code.)
  3. text.heading: adding a "foreground" color, doesn’t apply on "heading0X even if those specific headings are without a "foreground" key. When it applies?
  4. color.[accent0X/color]: didn’t get where/how are they used? - As I define used colors in "colors"and use them in scopes. So confused me a bit.

Any guidance is highly appreciated.
Thanks!

It might be easier to start with the Theme Builder if you are getting familiar with themes. You can open one from Drafts which is a good starting point for the changes you want to make and tweaks. It has some hinting, like scopes that are commonly used in the default themes are bolded.

Not all scopes are used in all syntaxes, so you will not always see direct correlations. Many are there are building blocks for custom syntaxes. I assume since you found the sample files, you read through the development docs about how the process works?

You can download and open a syntax file to compare. For example, you mention text.heading which is not used in the default Markdown syntaxes, instead the levelled scopes text.heading01, etc. are used.

Yes, that’s what I figured as well:

While there are many named scopes, some might be common in many markdown syntaxes and others not so much or with niche use-cases. There might not be a single syntax in the directory that uses 100% of them at once.

I believe it’s my lack of knowing different markdown applications & flavors of syntaxes that made many scopes like a guessing puzzle; I thought even if i wanted to make a syntax for it, i don’t know what it should be doing or even if it’s a used md syntax somewhere or internal Drafts thing.

Nevertheless all went well! Just finished and published what I aimed to do:

  1. Flexoki - Cyan Accent (Light) | Drafts Directory
  2. Flexoki - Cyan Accent (Dark) | Drafts Directory

I wished MAC app had any scopes that impacts at-least the editor bar areas (tags bar/paragraph numbers/actions bar) - even with toggling off side panels, pure white areas too annoying me :laughing:

Thanks a lot for your reply! (& app)