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