Diffs

Pierre themes

Beautiful light and dark themes, generated from a shared color palette, for Visual Studio Code, Cursor, and Shiki. Built first for @pierre/diffs, and shared with the community by The Pierre Computer Company.

Usage

Install the Pierre theme pack from your editor's extension marketplace:

  1. Visual Studio Code — Install from the VS Code Marketplace
  2. Cursor — Install from Open VSX
  3. Zed — Coming soon…

Then open your editor and select "Pierre Dark" or "Pierre Light" in settings or the command palette.

Build a theme

Create custom themes for use with @pierre/diffs (plus Shiki and Visual Studio Code based editors) by forking our open-source Pierre Theme repository.

The Pierre themes are bundled with @pierre/diffs as pierre-dark and pierre-light, so you can use them without any additional setup.

Getting started

The fastest way to create a custom theme is to fork the Pierre Theme repository, modify our color palette, and regenerate the themes. This repository uses TypeScript to generate theme JSON files, giving you type safety and the ability to generate multiple theme files—for various editors, too—from a single color palette.

  1. Fork the repo — Visit github.com/pierrecomputer/theme and click "Fork" to create your own copy
  2. Clone your forkgit clone https://github.com/YOUR_USERNAME/theme.git
  3. Install dependenciesnpm install
  4. Start the dev servernpm start (watches for changes and rebuilds)

Project structure

The Pierre Theme repository is organized as follows:

Color palette

The src/palette.ts file is the single source of truth for all colors in your theme. We take each color from the palette and provide several tints and shades for each, like 100, 200, 300, etc. We ship with all our tints and shades, so this is overkill for most themes, but it's sometimes helpful to have full access to your entire brand or product palette.

After defining your color scales, you define role types that map colors to semantic purposes—backgrounds, foregrounds, borders, accents, states, syntax highlighting, and ANSI terminal colors:

Then export light and dark theme configurations using your color scales:

The dark theme follows the same pattern with adjusted values for dark mode. After editing your palette, the build script automatically regenerates all theme variants. Each color in the palette is used consistently across light theme, dark theme, and vibrant variants.

See the full source files on GitHub:

Theme file

The src/theme.ts file maps your src/palette.ts colors to specific syntax tokens. This is where you control which colors are used for editor interface elements and syntax highlighting (keywords, functions,comments, strings, etc).

See the full source: src/theme.ts.

For a complete reference of TextMate scopes, see the VS Code syntax highlighting documentation and the TextMate language grammars manual.

Update package.json

Before publishing your theme, update the package.json with your own details. The VS Code Marketplace uses fields like displayName, description, icon, repository, and categories for your listing. See the extension manifest reference for all available fields.

Build & Test

The repository includes npm scripts for development:

ScriptDescription
npm startWatch mode — rebuilds on file changes
npm run buildGenerate theme JSON files in ./themes directory
npm testValidate theme structure (runs build first)
npm run packageCreate .vsix file for VS Code/Cursor publishing

Heads up! Our package script is specifically designed so that you can publish your theme to npm while also being used for generating the VS Code and Cursor extensions. We do this by temporarily renaming the package before generating the VSIX extension file. We replicate this in another way in our GitHub Action for automatically publishing the theme to the VS Code Marketplace and Open VSX on release.

Here's how these all come together. After you make your changes to the color palette, roles, theme file, and package.json:

  • Use npm run build to generate the ./themes directory with your theme JSON files.
  • Use npm run package to create the .vsix file.
  • Use npm run test to validate the theme structure.

After you've built your theme, you can upload the compiled .vsix file to the VS Code Marketplace or Open VSX, and use the theme JSON files with @pierre/diffs.

Using with Diffs

Once you've built your theme JSON files, you can use them with @pierre/diffs by registering them before rendering:

Then reference your theme in any component:

Vibrant themes

The Pierre Theme repo automatically generates "Vibrant" variants that use the Display P3 color space for ~25% more color range on compatible displays. These colors are generated automatically when you run npm run build and come from a color conversion algorithm.

Display P3 colors are not supported in VS Code or Cursor, so those theme files aren't generated. Instead, we only generate the .json files for use with @pierre/diffs and Shiki on the web.

The vibrant variants are generated automatically when you run npm run build. They use enhanced saturation to push colors into the wider P3 gamut. See the repo's DISPLAY-P3.md for technical details on the color conversion algorithm.

Publishing

To publish your theme to the VS Code Marketplace or Open VSX:

  1. Update package.json with your publisher ID and theme metadata
  2. Run npm run package to create the .vsix file
  3. Upload to the VS Code Marketplace or Open VSX

If you've forked our theme repository, we automate the publishing process. Our workflow uses GitHub Actions to build, test, and publish the package to npm and the theme extension to the VS Code Marketplace and Open VSX on release. You can adapt this workflow to your own repository—you’ll have to update some variables and add the appropriate secrets in your repository settings.

For Shiki/web use only, you can skip publishing and simply host your theme JSON files or bundle them with your application.


Credit

Thanks again to the Primer team at GitHub for their work on the open source GitHub VS Code themes. We forked their project and heavily modified it for our own themes.

With love from The Pierre Computer Company

Collectively, our team brings over 150 years of expertise designing, building, and scaling the world's largest distributed systems at Cloudflare, Coinbase, Discord, GitHub, Reddit, Stripe, X, and others.