133

I'm using Windows 7 64-bit.

Is there a way to edit default dark theme in the Visual Studio Code? In %USERPROFILE%\.vscode folder there are only themes from the extensions, while in installation path (I used default, C:\Program Files (x86)\Microsoft VS Code) there are files of some standard themes in \resources\app\extensions, like Kimbie Dark, Solarized Dark/Light or variants of Monokai, but there is no default dark theme.

But if after all there is a possibility to edit it, then which blocks of code are responsible for colour of member of object, member of pointer and name of class and structure in the C++ language?

Eje
  • 354
  • 4
  • 8
Toreno96
  • 1,541
  • 2
  • 14
  • 14
  • 7
    For anyone coming here: you don't need to hunt for and modify or create any theme files. Everything can be modified using `workbench.colorCustomizations` and `editor.tokenColorCustomizations` in user settings: https://code.visualstudio.com/docs/getstarted/themes#_customizing-a-color-theme. – chipit24 Jul 23 '18 at 18:18
  • One could also hold out for a stale, but being worked on feature that would allow us to add custom global CSS, like `Atoms Edit -> Stylesheet...` Last change to the issue was March https://github.com/Microsoft/vscode/issues/459 . It's disappointing that it's closed for comments. The current API does not allow for an extension to modify global CSS... so we'll have to wait, or manually paste CSS into the Developer Tools like caveman. – Ray Foss Jun 25 '19 at 22:36

15 Answers15

123

In VS code 'User Settings', you can edit visible colours using the following tags (this is a sample and there are much more tags):

"workbench.colorCustomizations": {
    "list.inactiveSelectionBackground": "#C5DEF0",
    "sideBar.background": "#F8F6F6",
    "sideBar.foreground": "#000000",
    "editor.background": "#FFFFFF",
    "editor.foreground": "#000000",
    "sideBarSectionHeader.background": "#CAC9C9",
    "sideBarSectionHeader.foreground": "#000000",
    "activityBar.border": "#FFFFFF",
    "statusBar.background": "#102F97",
    "scrollbarSlider.activeBackground": "#77D4CB",
    "scrollbarSlider.hoverBackground": "#8CE6DA",
    "badge.background": "#81CA91"
}

If you want to edit some C++ color tokens, use the following tag:

"editor.tokenColorCustomizations": {
    "numbers": "#2247EB",
    "comments": "#6D929C",
    "functions": "#0D7C28"
}
nik7
  • 806
  • 3
  • 12
  • 20
Chethaka Uduwarage
  • 1,527
  • 2
  • 12
  • 12
  • 1
    But if it's beyond tokenColorCustomizations, what do I do? – Alex May 19 '18 at 17:30
  • 1
    Where one can find a list of all available options in "editor.tokenColorCustomizations"? – ololobus Apr 09 '19 at 09:26
  • 12
    Oh, found it https://code.visualstudio.com/api/references/theme-color#editor-colors – ololobus Apr 09 '19 at 09:29
  • 2
    My edit was rejected for some reason, but to make this answer specifically address the OP's desire to change a specific theme you can specify the theme and modify colors without altering the theme's files: "workbench.colorCustomizations": { "[Kimbie Dark]": { "activityBar.foreground":"#472c0c" } } – aamarks Jun 08 '19 at 15:51
  • 1
    It's called "Workbench: Color Customizations" in the settings – Zach Saucier Mar 20 '20 at 19:08
  • 1
    Note that you need to add the option `"workbench.colorCustomizations": { }` to the settings.json if it doesn't already exist. Simply editing the options like `editor.background` in the main json tree won't work. – Yogesh Umesh Vaity Jan 08 '22 at 14:06
83

The file you are looking for is at,

Microsoft VS Code\resources\app\extensions\theme-defaults\themes

on Windows and search for filename dark_vs.json to locate it on any other system.


Update:

With new versions of VSCode you don't need to hunt for the settings file to customize the theme. Now you can customize your color theme with the workbench.colorCustomizations and editor.tokenColorCustomizations user settings. Documentation on the matter can be found here.

paarandika
  • 1,238
  • 12
  • 21
  • 15
    On Linux, it's in `/usr/share/code/resources/app/extensions/theme-defaults/themes` – sigalor Jul 24 '19 at 21:40
  • 2
    On Arch Linux, it's (open-source release) in `/usr/lib/code/extensions/theme-defaults/themes` – hendalst Nov 15 '19 at 03:11
  • 4
    By default, VS Code is installed in C:\users\{username}\AppData\Local\Programs\Microsoft VS Code – Toivo Säwén Mar 21 '20 at 13:15
  • 2
    The update to this answer is a sound recommendation. I found that if you edit the theme files directly, they can/will be overwritten on an update to VS Code. – cniggeler Jul 02 '20 at 12:38
  • 5
    Maybe this is obvious to others, but on Mac, it's in `/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/theme-defaults` – TimH Feb 23 '21 at 02:51
30

As far as the themes, VS Code is every bit as editable as Sublime. You can edit any of the default themes that come with VS code. You just have to know where to find the theme files.

Side note: I love the Monokai theme. However, all I wanted to change about it was the background. I don't like the dark grayish background. Instead, I think the contrast is WAY better with a solid black background. The code pops out much more.

Anyways, I hunted for the theme file and found it (in windows) at:

c:\Program Files (x86)\Microsoft VS Code\resources\app\extensions\theme-monokai\themes\

In that folder I found the Monokai.tmTheme file and modified the first background key as follows:

<key>background</key>
<string>#000000</string>

There are a few 'background' key in the theme file, make sure you edit the correct one. The one I edited was at the very top. Line 12 I think.

iviouse
  • 449
  • 6
  • 9
  • 5
    Ubuntu install locations are like `/usr/share/code/resources/app/extensions/theme-defaults/themes/dark_vs.json` – Max Mar 18 '17 at 15:02
  • 5
    And for mac, i found updating files in these paths worked: `/Users/user-name/.vscode/extensions/azemoh.one-monokai-0.3.3/themes/OneMonokai-color-theme.json` cmd+shift+p and type `reload window` cmd to immediately try out the change :) – balajikris Jul 21 '17 at 03:07
  • 1
    Modifying the background of the theme can also be done by `"workbench.colorCustomizations": { "[Theme You Want to Update]": { "editor.background": "#000000" }` In user settings. – Bilbo Feb 11 '18 at 15:14
  • 1
    For 64-bit VS Code on Windows, the base path is `C:\Program Files\Microsoft VS Code\resources\app\extensions\ `, usually followed by `theme-....` – Peter B Aug 28 '18 at 12:01
  • Modify the theme in the user settings with `"workbench.colorCustomizations": { "editor.background": "#000" },` . Here are the all the different customizations you can make: https://code.visualstudio.com/api/references/theme-color – Jeremy Moritz Aug 20 '19 at 14:52
26

Read if you want do to deep customisations

As others have stated, you must override the editor.tokenColorCustomizations or the workbench.colorCustomizations setting in the settings.json file. Here you can choose a base theme, like Abyss, and only override the things you want to change. You can easily things like the function, string colours, etc. However, you'll be limited to only a few items.

E.g. for workbench.colorCustomizations

"workbench.colorCustomizations": {
    "[Default Dark+]": {
        "editor.background": "#130e293f",
    }
}

E.g. for editor.tokenColorCustomizations:

"editor.tokenColorCustomizations": {
    "[Abyss]": {
        "functions": "#FF0000",
        "strings": "#FF0000"
    }
}
// Don't do this, looks horrible.

Deep customisations like changing the colour of the var keyword will require you to provide the override values under the textMateRules key.

E.g. below:

"editor.tokenColorCustomizations": {
    "[Abyss]": {
        "textMateRules": [
            {
                "scope": "keyword.operator",
                "settings": {
                    "foreground": "#FFFFFF"
                }
            },
            {
                "scope": "keyword.var",
                "settings": {
                    "foreground": "#2871bb",
                    "fontStyle": "bold"
                }
            }
        ]
    }
}

You can also override globally across themes:

"editor.tokenColorCustomizations": {
    "textMateRules": [
        {
            "scope": [
                //following will be in italics (=Pacifico)
                "comment",
                "entity.name.type.class", //class names
                "keyword", //import, export, return…
                //"support.class.builtin.js", //String, Number, Boolean…, this, super
                "storage.modifier", //static keyword
                "storage.type.class.js", //class keyword
                "storage.type.function.js", // function keyword
                "storage.type.js", // Variable declarations
                "keyword.control.import.js", // Imports
                "keyword.control.from.js", // From-Keyword
                //"entity.name.type.js", // new … Expression
                "keyword.control.flow.js", // await
                "keyword.control.conditional.js", // if
                "keyword.control.loop.js", // for
                "keyword.operator.new.js", // new
            ],
            "settings": {
                "fontStyle": "italic"
            }
        }
    ]
}

More details here: https://code.visualstudio.com/api/language-extensions/syntax-highlight-guide

Varun Achar
  • 14,781
  • 7
  • 57
  • 74
18

You cannot "edit" a default theme, they are "locked in"

However, you can copy it into your own custom theme, with the exact modifications you'd like.

For more info, see these articles: https://code.visualstudio.com/Docs/customization/themes https://code.visualstudio.com/docs/extensions/install-extension#_your-extensions-folder

If all you want to change is the colors for C++ code, you should look at overwriting the c++ support colorizer. For info about that, go here: https://code.visualstudio.com/docs/customization/colorizer

EDIT: The dark theme is found here: https://github.com/Microsoft/vscode/tree/80f8000c10b4234c7b027dccfd627442623902d2/extensions/theme-colorful-defaults

EDIT2: To clarify:

Tobiah Zarlez
  • 1,680
  • 1
  • 12
  • 13
  • 1
    And from where can i copy it? In articles that you sent me there is nothing about it. And I don't want to install anything for such a trivial thing like changing syntax highlighting a little - especially when I could just open the right file and modify a few lines of code, if the default theme wasn't locked. Besides, generating a new theme with Yeoman Generator needs .tmTheme file of another theme - there's no Visual Studio dark theme on the ColorSublime website and I don't have access to the "locked one" from VSC. – Toreno96 Feb 04 '16 at 00:22
  • Maybe I could edit the c++.plist file from "C:\Program Files (x86)\Microsoft VS Code\resources\app\extensions\cpp"? But which blocks of code should I change? Or maybe there is a source file of the VSC default dark theme somewhere, which I could use to make my own custom theme? – Toreno96 Feb 04 '16 at 00:22
  • You can't edit it, because I believe it's saved within the source code. You can however copy/paste it and change a couple of lines. It's located on the GitHub. I found it for you: https://github.com/Microsoft/vscode/tree/80f8000c10b4234c7b027dccfd627442623902d2/extensions/theme-colorful-defaults Edited answer with link – Tobiah Zarlez Feb 04 '16 at 05:41
  • It is possible to edit the c++.plist file that I mention, I checked that. And I understood from article about colorizers that it is a standard colorizer file for C++ language. Correct me if I'm wrong. But if you still talking about editing the default theme - yes, I know I can't do that, I understood sentence about it from your first answer. Thanks for the information about source code on GitHub and link - but I checked and themes from there aren't the default ones, but modified, more colorful variation of these. Unfortunately, not in a way I would want to. – Toreno96 Feb 04 '16 at 11:55
  • 1
    But by accident I found out, that the "Xcodedefault" theme from extension gallery have the same syntax highlighting that the default dark one. Because it is in extension folder on my disk now, after installation, I can modify it, just like I wanted to modify default dark theme. So, my problem is solved. – Toreno96 Feb 04 '16 at 11:55
  • The referenced tmTheme file in this answer is now very out of date, and does not exit in master - dark_vs and dark_plus are now JSON files. To edit off the built-in themes we now need some way to convert that JSON into a tmTheme file. – Jonathan Edwards Nov 17 '16 at 15:16
18

The simplest way is to edit the user settings and customise workbench.colorCustomizations

Editing color customizations

If you want to make your theme

There is also the option modify the current theme which will copy the current theme settings and let you save it as a *.color-theme.json JSON5 file

Generate color theme from current settings

Jay Wick
  • 12,325
  • 10
  • 54
  • 78
17

tldr

You can get the colors for any theme (including the builtin ones) by switching to the theme then choosing Developer > Generate Color Theme From Current Settings from the command palette.

Details

  1. Switch to the builtin theme you wish to modify by selecting Preferences: Color Theme from the command palette then choosing the theme.

  2. Get the colors for that theme by choosing Developer > Generate Color Theme From Current Settings from the command palette. Save the file with the suffix -color-theme.jsonc.
    The color-theme part will enable color picker widgets when editing the file and jsonc sets the filetype to JSON with comments.

  3. From the command palette choose Preferences: Open Settings (JSON) to open your settings.json file. Then add your desired changes to either the workbench.colorCustomizations or tokenColorCustomizations section.

    • To restrict the settings to just this theme, use an associative arrays where the key is the theme name in brackets ([]) and the value is an associative array of settings.
    • The theme name can be found in settings.json at workbench.colorTheme.

For example, the following customizes the theme listed as Dark+ (default dark) from the Color Theme list. It sets the editor background to near black and the syntax highlighting for comments to a dim gray.

// settings.json
"workbench.colorCustomizations": {
    "[Default Dark+]": {
        "editor.background": "#19191f"
    }
},
"editor.tokenColorCustomizations": {
    "[Default Dark+]": {
        "comments": "#5F6167"
    }
},

Alissa H
  • 450
  • 4
  • 7
14

Any color theme can be changed in this settings section on VS Code version 1.12 or higher:

 // Overrides colors from the currently selected color theme.
  "workbench.colorCustomizations": {}

See https://code.visualstudio.com/docs/getstarted/themes#_customize-a-color-theme

Available values to edit: https://code.visualstudio.com/docs/getstarted/theme-color-reference

EDIT: To change syntax colors, see here: https://code.visualstudio.com/docs/extensions/themes-snippets-colorizers#_syntax-highlighting-colors and here: https://www.sublimetext.com/docs/3/scope_naming.html

needfulthing
  • 1,056
  • 11
  • 21
  • With that you can override the colors of the editor itself but no the colors of some keywords ( ex: strings color ). – Jhegs Aug 09 '17 at 17:31
9

Solution for MAC OS

I'm not sure if this answer suits here, but I would like to share a solution for MAC users and it looks awkward if I start a new question and answer myself there.


look for your VSCode theme path something like below:

..your_install_location/Visual Studio Code.app/Contents/Resources/app/extensions/theme-name/themes/theme_file.json

open .json file and look for your targeted styles to change.
For my case, I want to change the whitespace render colour
and I've found it as
"editorWhitespace.foreground"
so under settings.json in Visual Studio Code,
I added the following lines (I do in Workspace Settings),

"workbench.colorCustomizations": {
    "editorWhitespace.foreground": "#93A1A130" // stand as #RRGGBBAA
}

Solutions guided from : https://code.visualstudio.com/docs/getstarted/themes#_customize-a-color-theme


Don't forget to ⌘ Command+S save settings to take effect.

elliotching
  • 972
  • 1
  • 10
  • 33
3

The latest version of VS code you can customize the colors to make it more personalized using the workbench as in the gif image below :

enter image description here

Go to Settings > Color Customization > Edit in settings.json

Add your color settings for using the editor.tokenColorCustomizations, for example to change the comments across all the default Dark++ theme, you can add this code :

"editor.tokenColorCustomizations":{
        "comments": "#fff000"
  }
NJENGAH
  • 955
  • 15
  • 12
2

The docs now have a whole section about this.

Basically, use npm to install yo, and run the command yo code and you'll get a little text-based wizard -- one of whose options will be to create and edit a copy of the default dark scheme.

Lee Goddard
  • 10,680
  • 4
  • 46
  • 63
2

I came here to find a way to edit the theme, but could not find it on my Mac. After a deep dive, finally I found the install place:

~/.vscode/extensions

All extensions in there!

Code Knox
  • 1,155
  • 10
  • 15
1
ctrl+k+t if you want to switch from a dark theme to other theme

For customizing default dark theme, 

1 Click on the left bottom gear(Manage) on visual studio 
2 Select Settings
3 Type JSON in search settings, Click on Edit JSON Settings
4 Inside Workspace settings in the left columns, paste the following code.
5 Hover over each property and change the default # color value to the one             
  liked

        
"workbench.colorCustomizations": {
    "list.inactiveSelectionBackground": "#C5DEF0​",
    "sideBar.background": "#F8F6F6​",
    "sideBar.foreground": "#000000​",
    "editor.background": "#FFFFFF​",
    "editor.foreground": "#000000​",
    "sideBarSectionHeader.background": "#CAC9C9​",
    "sideBarSectionHeader.foreground": "#000000​",
    "activityBar.border": "#FFFFFF​",
    "statusBar.background": "#102F97​",
    "scrollbarSlider.activeBackground": "#77D4CB​",
    "scrollbarSlider.hoverBackground": "#8CE6DA​",
    "badge.background": "#81CA91​"}
  • The question asks how to customize the default dark theme, not how to switch to another existing one. – Toreno96 Apr 28 '21 at 09:59
  • Thank you for pointing out, I was looking for changing the default theme the other day and in hurry, I thought the question was about changing the theme. Although there are plenty of other solutions suggested for this one, here is one way to edit the default theme, someone may have posted it already or may not, sharing in the community goes on, cheers – Skilled Knight Apr 29 '21 at 10:35
1

In order to make sure this settings work, you also need to select your current theme in the tokenColorCustomizations otherwise you might get an error as "overrides colors from the currently selected color theme"

  "editor.tokenColorCustomizations": {
        "[Default Dark+]": {
            
        },      
    },
    "workbench.colorCustomizations": {
        "editor.selectionBackground": "#0698b9",
        "editor.selectionHighlightBackground": "#0b5768",
        "editor.findMatchBorder":"#ff0000"
    },

vscodethemesettings

0

In Ubuntu with VS Code installed as a snap package, I found the theme at /snap/code/55/usr/share/code/resources/app/extensions/theme-defaults/themes/dark_plus.json

Mikhail
  • 20,685
  • 7
  • 70
  • 146
  • It would be helpful to specify the installation method you used: I guess it's the snap package, but when installing vscode using `apt` the path probably would be different. – Toreno96 Apr 13 '21 at 11:51