121

MacOS now supports both "Light" and "Dark" mode (found in "System Preferences", "General", "Appearance").

How can I make VS Code automatically change its theme to be light or dark, when I change my MacOS "Appearance"?

JBallin
  • 11,567

3 Answers3

175
  1. Enable Auto Detect (Search in Settings: window.autoDetectColorScheme)
  2. Customize Color Themes (Search in Settings: workbench preferred color theme)

More Detail (Visual Studio Code Themes):

Auto switch based on OS color scheme Windows and macOS support light and dark color schemes. There is a setting, window.autoDetectColorScheme, that instructs VS Code to listen to changes to the OS's color scheme and switch to a matching theme accordingly.

To customize the themes that are used when a color scheme changes, you can set the preferred light, dark, and high contrast themes with the settings:

workbench.preferredLightColorTheme - defaults to "Default Light+" workbench.preferredDarkColorTheme - defaults to "Default Dark+" workbench.preferredHighContrastColorTheme - defaults to "Default High Contrast" workbench.preferredHighContrastLightColorTheme - defaults to "Default High Contrast Light"

JBallin
  • 11,567
  • And is it possible to manually override this setting? Like having a switch/command that switches to the preferred dark theme, even though my system setting is light. – LinusGeffarth Mar 18 '20 at 11:25
  • @LinusGeffarth I just manually make the switch (instructions below - quite easy!). Haven’t looked for a way to switch based on the workbench setting. https://code.visualstudio.com/docs/getstarted/themes – JBallin Mar 18 '20 at 18:44
57

Go to settings and search for theme -> Auto Detect Color Scheme

enter image description here

GorvGoyl
  • 699
  • 4
  • 7
0

I also found that property "workbench.colorTheme" is not well working with auto theme switcher. So I added it to ignore and now all works like a charm.

  "workbench.colorTheme": "GitHub Light",
  "settingsSync.ignoredSettings": [
    "workbench.colorTheme"
  ],