Neil Gaetano Lindberg
Neil Gaetano Lindberg

Reputation: 2935

Customize quoted strings in VS Code

The value side of attributes in HTML were very unreadable, too dark, making it especially hard to disseminate between class names in HTML, when using the dark theme on VS Code. How do I change it to make reading more comfortable?

p.s. My "Tags" are very limited due to rep, but I'm so sure others have this question.

Upvotes: 2

Views: 488

Answers (1)

Neil Gaetano Lindberg
Neil Gaetano Lindberg

Reputation: 2935

Here is how to accomplish this particular task. Introducing [me to] a very useful tool: Inspect Editor Tokens and Scopes

  1. Put cursor in, in this case, a quoted value string.
  2. CNTL + SHIFT + P (open command palette).
  3. Find "Developer: Inspect Editor Tokens and Scopes"
  4. Note the textmate scope(s).
  5. Use property: "editor.tokenColorCustomizations" → "textMateRules" to add new rule.

While I'm doing this directly on values in the JSON of settings - and changing quotes there at a high level, this also works with inheritance, so string.quoted.double.html would override the example shown in this screenshot (which applies to ALL double quoted strings), when editing HTML files. I find this useful for making my lint rules standout too.enter image description here

Upvotes: 2

Related Questions