Color Theme
Colors visible in the Visual Studio Code user interface fall in two categories:
- Workbench colors used in views and editors, from the Activity Bar to the Status Bar. A complete list of all these colors can be found in the theme color reference.
- Syntax colors and styles used for source code in the editor. The theming of these colors is different as syntax colorization is based on TextMate grammars and TextMate themes as well as semantic tokens.
This guide will cover the different ways in which you can create themes.
Workbench colors
The easiest way to create a new workbench color theme is to start with an existing color theme and customize it. First switch to the color theme that you want to modify, then open your settings and make changes to the workbench.colorCustomizations
setting. Changes are applied live to your VS Code instance.
The following, for example, would change the background color of the title bar:
{
"workbench.colorCustomizations": {
"titleBar.activeBackground": "#ff0000"
}
}
A complete list of all themable colors can be found in the color reference.
Syntax colors
For syntax highlighting colors, there are two approaches. You can reference an existing TextMate theme (.tmTheme
file) from the community, or you can create your own theming rules. The easiest way is to start with an existing theme and customize it, much like in the workbench colors section above.
First switch to the color theme to customize and use the editor.tokenColorCustomizations
settings. Changes are applied live to your VS Code instance and no refreshing or reloading is necessary.
For example, the following would change the color of comments within the editor:
{
"editor.tokenColorCustomizations": {
"comments": "#FF0000"
}
}
The setting supports a simple model with a set of common token types such as 'comments', 'strings' and 'numbers' available. If you want to color more than that, you need to use TextMate theme rules directly, which are explained in detail in the Syntax Highlighting guide.