Case study · 02
Vaporwave '95
A VS Code theme with a neon glow that VS Code has no API for.

- 0npm dependencies, and no build step
- 2themes, the light one generated from the dark
- 6.5:1lowest syntax contrast on the dark theme
- 2VS Code versions the patch is round-trip tested on
The problem
A colour theme of my own, from the softer, surreal side of vaporwave: pastel pink, aqua, mint and lilac on a dusky violet, rather than synthwave’s hot neon on black. Dark and light, and readable first, so every syntax colour has to pass a contrast check.
The optional neon glow is the hard part. VS Code has no API for glowing text, so, like SynthWave ’84’s Neon Dreams, the extension has to patch VS Code’s own install. It must do that without VS Code reporting itself as corrupt, and undo itself cleanly when you disable it, update VS Code or uninstall the extension.
Architecture
The themes are plain JSON. The glow is a small script copied next to VS Code’s workbench.html and loaded with one script tag, which VS Code’s content security policy already allows, so the policy is never touched. Everything that reads or writes the install lives in one module, patch.js, which doesn’t depend on the VS Code API, so it can be tested against real VS Code files without running VS Code. The extension itself only decides when to call it.
Extension
- Two declarative JSONC themes. The light theme is generated: a script swaps every dark colour through a palette map, and a dark colour missing from the map is an error, so the two can’t drift apart.
- A check script parses both themes, tests every token colour against its background (at least 4.5:1, comments 4.0:1), confirms the glow colours exist in the dark theme and fails if the light theme is out of date.
- On startup the extension compares what’s installed with what it would write now (missing, off, stale or current). After a VS Code update or a settings change it offers to re-apply the glow. It never patches anything without a click.
- The two settings end up as JavaScript inside VS Code, so they’re forced to a number between 0 and 1 and a boolean, and scoped to the application so a workspace can’t set them.
- A browser entry point for vscode.dev and github.dev: the themes work there, and the glow commands explain why they can’t.
Delivery
- No dependencies and no build step: the files in the repo are the extension as shipped. GitHub Actions runs the checks and the patch tests, then packages the extension, on Windows, macOS and Linux.
- The launch site is a static Astro site in my monorepo, deployed like the others on my VPS. It has a raw WebGL sunset, a live glow demo drawn in the theme’s own colours that writes your settings.json, and install routes for VS Code, Cursor, VSCodium, Windsurf and vscode.dev.
Interesting problems
01
The “corrupt installation” warning
VS Code checksums its own files. After patching workbench.html the extension writes the new hash into product.json, using whichever algorithm is already there (MD5 on older builds such as 1.60, SHA-256 on newer ones). It replaces only that one value in the text, because re-serialising the JSON would reformat the file. VS Code only reads checksums at launch, so the extension asks you to quit, not reload.
02
Leaving no trace
Disable has to put workbench.html and product.json back byte for byte, line endings included. The tests round-trip real files from VS Code 1.60 (LF, MD5) and 1.148 (CRLF, SHA-256), and .gitattributes keeps those fixtures’ bytes exact. An uninstall hook runs disable on the next start, finding the install from VS Code’s own executable path on each OS.
03
Knowing which theme is on
The glow script runs inside VS Code’s window, without the extension API. It reads the token colours the editor writes into a stylesheet, and only lights up when every glow colour is present, which is true for the dark theme and no one else’s. A MutationObserver re-checks on theme changes, and ignores its own style writes so it can’t loop.
Outcome
Version 1.0.0: dark and light themes that work everywhere VS Code does, plus an optional glow that patches and restores VS Code cleanly, tested end to end on VS Code 1.60 and 1.148 on Windows.
A launch site where people can try the glow settings before installing, then install in one click.