skip to content

Search

How to Enable Automatic Theme Switching in VS Code

1 min read

Quick tip: Enable automatic theme switching in VS Code to match your system's light and dark mode. Includes setup via settings.json.

If you’re tired of manually switching your theme in VS Code when your system switches from light to dark mode (or vice versa), here’s a simple fix.

VS Code supports automatic theme switching using the window.autoDetectColorScheme setting, which syncs your editor theme with your system theme. This works best if your OS supports auto theme scheduling, like macOS’s appearance settings or Windows Night Light.

To set it up:

  1. Open the command palette with Cmd+Shift+p (macOS) / Ctrl+Shift+p (Windows/Linux)
  2. Select Preferences: Color Theme to check available themes
  3. Add the following to your settings.json:
{
  "window.autoDetectColorScheme": true,
  "workbench.preferredDarkColorTheme": "Visual Studio Dark",
  "workbench.preferredLightColorTheme": "Visual Studio Light"
}