Get in touch
← Things I’ve built

Case study · 02

Vaporwave '95

A VS Code theme with a neon glow that VS Code has no API for.

Role
Solo: design, extension, tests, launch site
Stack
JavaScript · VS Code extension API · Node · GitHub Actions · Astro · WebGL · GSAP
Live
vaporwave.alexsell.co.uk ↗
The Vaporwave '95 website

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.

Architecture of Vaporwave '95. In the extension host, extension.js runs the Enable and Disable commands and a startup check, and calls patch.js; uninstall.js also calls patch.js on the next start after an uninstall. patch.js writes into VS Code's install folder: one script line in workbench.html, the glow script vaporwave95-glow.js beside it with the settings baked in, and the workbench.html checksum in product.json. In the workbench window, the glow script reads the editor's token colours and adds text-shadows. In the repo, check.js, test.js and build-light.js run in CI on Windows, macOS and Linux.Extension host · NodeVS Code install · resources/appWorkbench window · rendererRepo · CI on Windows, macOS and Linuxextension.jscommands · startup checkpatch.jsenable · disable · statusuninstall.jsnext start after uninstallworkbench.html+ one script tagvaporwave95-glow.jssettings baked inproduct.jsonone checksum valueglow.js at runtimetoken colours → text-shadowcheck.jscontrast · light theme freshtest.jsround trips: 1.60 + 1.148build-light.jslight theme from the darkpatchloads
One module touches the install, and everything it adds can be taken away again.

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

  1. 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.

  2. 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.

  3. 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.