34

How do I change VS Code tab colors? Is there an attribute in settings.json (i.e. a corollary to "tab.activeBorder": "#18aa83") for background color?

VS Code tabs

6
  • It would be great to have an extension for this. Commented Oct 31, 2021 at 1:12
  • 2
    More information on styling tabs, can be found here: code.visualstudio.com/api/references/… Commented Oct 31, 2021 at 1:17
  • 2
    I wrote an extension which colors the active tab based on some file regex, making it super comfortable when working on monorepos or client/server shared repos. Check it out - marketplace.visualstudio.com/… Commented Jun 13, 2022 at 19:05
  • @carloswm85 you can try marketplace.visualstudio.com/items?itemName=mondersky.tabscolor Commented Oct 27, 2022 at 8:38
  • @mondersky awesome. It looks pretty good. It has some pretty nice features. Thanks for the lead. Commented Oct 27, 2022 at 12:39

3 Answers 3

74

VS Code documents color customizations for tabs in the theme color api.

To edit the tab colors you can use the following identifiers:

{
    "workbench.colorCustomizations": {
        "tab.activeBackground": "#ff0000",
        "tab.inactiveBackground": "#ff0000"
    }
}

You add that to your settings.json file

tab picture

To change the tabs header you can use the following:

"workbench.colorCustomizations": {
    "editorGroupHeader.tabsBackground": "#ff0000",
}

header group picture


You can type tab. and it will suggest similar properties you can change

Sign up to request clarification or add additional context in comments.

3 Comments

Greaty! Tranks for answer.
how do I get to settings.json ?
this works nicely.
8

In settings.json , add below details. It will be helpful as some text colors are dim. This setting works well.

Also if you want to set colors based on themes this will be helpful.

"workbench.colorCustomizations": {
    "[Visual Studio Dark]": {
        "tab.activeBorderTop": "#6a6ce4",
        "tab.activeBackground": "#182952",
        "tab.activeBorder": "#6a6ce4"
    },
    "[Default Dark+]": {
        "tab.activeBorderTop": "#6a6ce4",
        "tab.activeBackground": "#180753",
        "tab.activeBorder": "#6a6ce4"
    },
    "editor.lineHighlightBackground": "#1073cf2d",
    "editor.lineHighlightBorder": "#9fced11f"
},

Comments

0

You can only target the active tab with the theme color API though, the only workaround I found to this is to patch vs code and inject arbitrary javascript code that will manipulate the tabs html, tabsColor does this

enter image description here

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.