Ever found a theme you really liked but there were just a few small blemishes that kept gnawing at you?
It happened to me with the Monokai theme that comes with VSCode. But fortunately, VSCode allows you to modify almost every single aspect of a theme.
There are two types of customization available in VSCode.
- workbench.colorCustomizations
- editor.tokenColorCustomizations
workbench.colorCustomizations
This allows you to customize the VSCode interface. You can customize the sidebars, various backgrounds, status bar, mini-map and much more. I mainly used it to tune the colors to increase contrast.
Here’s how to access and customize it:
- Open the user settings by hitting
ctrl + shift + P
and searching forPreferences: Open Settings (JSON)
. - Create the
workbench.colorCustomization
JSON property if it’s not already created. - Create a nested property with your theme’s name in
[]
such as[Monokai]
. - Create an object.
- Add and modify the properties you want.
Check out the full list of options here.
Here’s how mine looks with the customizations for the Monokai theme.
|
|
editor.tokenColorCustomizations
This lets you modify the syntax highlighting of the theme.
Here are the steps:
- Open the user settings by hitting
ctrl + shift + P
and searching forPreferences: Open Settings (JSON)
. - Create the
editor.tokenColorCustomizations
JSON property if it’s not already created. - Create a nested property with your theme’s name in
[]
such as[Monokai]
. - Create another nested property called
textMateRules
and initialize to an empty array. - Create objects with
scope
andsettings
keys to modify the defined scopes.
How to Find Out TextMate Scope in VSCode
If you are not familiar with TextMate scopes here’s how to figure them out in VSCode:
- Hit
ctrl + shift + P
. - Search for
Developer: Inspect Editor Tokens and Scopes
and hit enter.
This will open a window and show you all the details about that scope.
Here’s my code:
|
|