Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I customise the color of HTML tags in Visual Studio Code?

I'm using the Abyss theme which I like, but certain colors are too dark. I have customized some token colors using (for instance):

"editor.tokenColorCustomizations": {
    "[Abyss]": {
        "keywords": "#7ea4df",

but I can't figure out how to change the color of HTML tags in the editor. Can anyone help?

like image 437
see sharper Avatar asked May 09 '18 00:05

see sharper


People also ask

How do you add a custom color in Visual Studio?

Within the Visual Studio Designer, under the properties window you are able to select the ForeColor , BackColor etc using color picker. When you want to pick a color, a color picker comes up with the tabs 'Custom, Web, System'.

How do you get the color picker in VS Code?

Press "CTRL + SHIFT + P", a drop-down box will be displayed at the top of VS Code, the items there are arranged in alphabetical order, so you might want to scroll down to find the installed extension "VS Color Picker", or you can use the search box provided to get the installed extension.

How do I change the color scheme in Visual Studio?

Here's how to change the color theme of the IDE frame and the tool windows in Visual Studio. On the menu bar, choose Tools > Options. In the options list, choose Environment > General. In the Color theme list, choose either the default Dark theme, the Light theme, the Blue theme, or the Blue (Extra Contrast) theme.


1 Answers

You can go into the theme's .json file and modify it to suit your needs, as mentioned in this post. Mine was located in C:\Program Files\Microsoft VS Code\resources\app\extensions\theme-abyss\themes

EDIT: As pointed out in the comments by @www-0av-Com, the path to the file is now C:\Users\<username>\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\theme-abyss\themes, where <username> is your Windows user.

You can use Ctrl + Shift + P to open the Command Palette and then open up the Developer: Inspect Editor Tokens and Scopes to look at the TextMate scope of the element you're interested in modifying. In the case of the HTML tag in the abyss theme it's entity.name.tag. You can see what the Scope Inspector looks like in the second image below.

Then go into the abyss-color-theme.json file and search for that string and modify the color of the tags as you see fit. I changed mine to an ugly orange color as below:

Modifying the theme source

Modified HTML tag coloring

like image 67
Mihai Chelaru Avatar answered Oct 20 '22 16:10

Mihai Chelaru