Victor Valeanu
Victor Valeanu

Reputation: 438

Angular - How to change variable's color in html file in VS Code?

Question has been asked before, but with no answers.

I have this snippets in html and ts component files:

enter image description here

enter image description here

I would like to have the variables: allowNewServer and serverCreationStatus colored purple.
My VS Code plug-ins: Angular Essentials (Version 9)

Upvotes: 2

Views: 3088

Answers (1)

C.OG
C.OG

Reputation: 6529

I use this VS Code plugin that adds syntax highlighting to angular html templates.

To further enhance to color it specifically purple, you'll have to tweak your theme or editors textMateRules settings.

In your settings.json:

"editor.tokenColorCustomizations": {
      "textMateRules": [
        {
          "scope": [
            "expression.angular-interpolation",
            "source.directive.angular"
          ],
          "settings": {
            "foreground": "purple" // or use your desired hex code
          }
        },
      ]
  },

Upvotes: 4

Related Questions