Do themes have an `@import` functionality like CSS?

I’m creating a syntax for TodoTxt. It’s quirky, each line is an individual task. Formatting is required to make tasks easier to read.

Is there a way of importing an existing theme to make changes as needed? CSS uses the @import:"style.css". Can this be done in Themes or via Syntax?

I’d like to keep whatever theme I’ve chosen but add some styles like increased margins, or hanging indents to the existing styles.

Thanks for your time,
Richard

They would be new themes or syntaxes. There is no hierarchy or inheritance to them. Syntaxes define the structures and themes hook them up to change how they are displayed, so if you want to visually show something through styling, the syntax would provide the specification that the theme would reference to determine how to show it.

The full sets of documentation are available from the web site page on developing syntaxes and themes.

Generally, the best starting point is to clone an existing one and modify it.

I realize that. :slight_smile:

I’ve managed to do a lot with by just changing the syntax and sticking to the default styles. It makes things much simpler and easier to maintain. TodoTxt is pretty easy compared to Markup or other syntaxes, the RegEx ins’t complicated.

I was hoping that I could I avoid managing another 600+ lines when I only need to tweak 3 or 4. Importing a Theme and simply overwriting / expanding a couple of styles would make it a lot easier.

I figured out a work-around, but I have to add a leading character to indicate the line is task. The RegEx selects only the leading character and makes it extraLarge. That forces a space between the task items.

Not elegant. But on the balance, better than managing and entire Theme.

todotxt

I’ve done this:

    {
      "match": "^(?: *(\\.) )",
      "exclusive": false,
      "comment":  "Set task marker to extraLarge that creates separation between paragraphs.",
      "captures": {
        "1": {
            "scope": "text.normal.extraLarge"
        }
    }
},
    {
      "match": "^(?: *(x) )(.*)",
      "exclusive": true,
      "comment":  "Match completed tasks. Exclusive to stop highlighting.",
      "captures": {
        "1": {
            "scope": "text.strikethrough,text.normal.extraLarge,color.gray"
        },
          "2": {
              "scope": "text.strikethrough,text.normal.small,color.gray"
          }
    }
},