microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
163.21k stars 28.86k forks source link

[themes] Add a light/dark theme context variable #224927

Open soyrubio opened 2 months ago

soyrubio commented 2 months ago

It would be beneficial to have a context variable available showing if the current theme is light or dark, i.e. usesLightTheme and usesDarkTheme.

aeschli commented 2 months ago

The vscode API already allows you to get that information:

window.activeColorTheme.kind

Is that good enough? If not can you elaborate on your use case?

Note if your extension has code you could use that API to create a context variable (that encapsulates even more state)

soyrubio commented 1 month ago

Thanks, didn't know about window.activeColorTheme.kind, this solves the issue 👍