microsoft / microsoft/vscode

Webview panels (Release Notes, extension panels) render with unreadable dark-on-dark contrast on cold start until theme is manually re-toggled

Open
#328,555 0 comments 0 reactions 1 assignee Claimed by @mrleemurray View on GitHub
Dominant language
TypeScript
Stars
193k
Forks
42.4k
PR merge metrics
PR metrics pending

Description

Does this issue occur when all extensions are disabled?: Yes

- VS Code Version: 1.131.0
- OS Version: Windows 10 Pro 10.0.19045

Steps to Reproduce:

1. Launch VS Code with `code --disable-extensions --new-window` (or just cold-start VS Code normally; also reproduces on an extension's auto-restored panel webview, but this is the minimal extension-free repro).
2. Open the Command Palette and run `Help: Show Release Notes`.
3. The Release Notes webview opens with unreadable dark-on-dark contrast — background renders dark, but the text stays black, as if the `--vscode-*` theme CSS variables were never injected into the webview at initial paint.
4. Manually switch `workbench.colorTheme` to a different theme and back (or run `Preferences: Color Theme` and reselect the current theme). Contrast instantly fixes itself for any webview opened afterward in that session — this forces VS Code to re-broadcast theme variables to webviews.
5. Close the window and repeat from step 1 — the bug reappears on the next cold start, even with `workbench.colorTheme` explicitly set in settings.json (not a "no default theme" issue).

**Environment details**
- OS app color mode: Light (`AppsUseLightTheme=1` in registry), workbench.colorTheme: Dark Modern (also reproduces with `window.systemColorTheme` forced to `"dark"`).
- Also observed on a third-party extension's panel webview when it auto-restores from a previous session, in addition to the built-in Release Notes webview — pointing to a general race in webview theme-variable injection on cold start / panel restore, not specific to any one webview's content.

**Suspected cause**
Timing race on cold start: the webview is rendered/painted before the workbench's color theme service finishes initializing and pushing `--vscode-*` CSS variables to it. A manual theme change works around it by forcing a re-broadcast to all currently open webviews.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.