visual-studio-codethemes

Finding the theme element name in Visual Studio Code to change its color


I'm modifying a Visual Studio Code theme to my liking. However, I have problems in finding the correct element name from https://code.visualstudio.com/api/references/theme-color.

Is there an extension or other way to get the specific element to modify the color? Something like "Select the element in the page to inspect it (Ctrl+Shift+C)" in Google Chrome developer console?
To be more specific, I'm trying to find the element name for this purple line to change it to a bit less aggressive color:

Purple border

Any help in finding the element name in general or in finding the name of that element?


Solution

  • I found the solution myself with this answer: https://stackoverflow.com/a/47970668/9810067

    To give an exact answer, yes, you can open a Chrome-like developer console (It's actually identical to Chrome) by typing "Developer: Toggle Developer Tools" into the command palette (Ctrl+Shift+P), but this didn't quite help me.

    While I was able to get the element class with "Select an element in the page to inspect it" (Ctrl+Shift+C)", I didn't manage to get the name that I could put into settings.json.

    What did the trick for me was typing "Developer: Generate Color Theme From Current Settings" into the command palette. From there I managed to find "editorGroup.border", which was just the element of which I wanted to change the color.

    Then I just opened my VSCode settings.json (determine settings scope with the help of this) and added there:

    {
       ...
        "workbench.colorCustomizations": {
            ...
            "editorGroup.border": "#9fb3c0ad",
            ...
        }
        ...
    }
    

    and there you have it.