# twbs/bootstrap-vscode-theme architecture

> Architecture diagram of the GitHub repository twbs/bootstrap-vscode-theme, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/twbs/bootstrap-vscode-theme
- Repository: https://github.com/twbs/bootstrap-vscode-theme

## Overview

Bootstrap VS Code Theme is a theme package for VS Code, Shiki, and compatible tools. Its build-time workflow takes light/dark role palettes, maps them into editor UI and syntax-token theme data, and also converts palette colors to enhanced Display P3 for vibrant variants before writing four theme JSON files. Consumers import those generated themes through the package entry point. README documents the editor and Shiki use cases; source evidence for implementation relationships is limited to the sampled build, palette, P3, and theme files.

Main entry points: [`src/build.ts`](https://github.com/twbs/bootstrap-vscode-theme/blob/main/src/build.ts) (Theme build), [`index.js`](https://github.com/twbs/bootstrap-vscode-theme/blob/main/index.js) (Theme exports), [`src/palette.ts`](https://github.com/twbs/bootstrap-vscode-theme/blob/main/src/palette.ts) (Light/dark roles), [`src/color-p3.ts`](https://github.com/twbs/bootstrap-vscode-theme/blob/main/src/color-p3.ts) (P3 conversion)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_palette["Palette and color"]
  node_palette_roles["Light/dark roles<br/>[palette.ts]"]
  node_p3_conversion["P3 conversion<br/>[color-p3.ts]"]
end

subgraph group_generation["Theme generation"]
  node_theme_mapping["UI and syntax mapping<br/>[theme.ts]"]
  node_build["Theme build<br/>[build.ts]"]
  node_theme_json["Four theme JSONs"]
end

subgraph group_consumption["Theme consumption"]
  node_package_entry["Theme exports<br/>[index.js]"]
end

node_consumer(("Theme user"))
node_vscode(("VS Code"))
node_shiki(("Shiki tools"))

node_build -->|"imports roles"| node_palette_roles
node_build -->|"converts roles"| node_p3_conversion
node_build -->|"builds themes"| node_theme_mapping
node_build -->|"writes files"| node_theme_json
node_package_entry -->|"imports themes"| node_theme_json
node_consumer -.->|"imports package"| node_package_entry
node_consumer -->|"selects theme"| node_vscode
node_consumer -->|"uses themes"| node_shiki

click node_palette_roles "https://github.com/twbs/bootstrap-vscode-theme/blob/main/src/palette.ts"
click node_p3_conversion "https://github.com/twbs/bootstrap-vscode-theme/blob/main/src/color-p3.ts"
click node_theme_mapping "https://github.com/twbs/bootstrap-vscode-theme/blob/main/src/theme.ts"
click node_build "https://github.com/twbs/bootstrap-vscode-theme/blob/main/src/build.ts"
click node_package_entry "https://github.com/twbs/bootstrap-vscode-theme/blob/main/index.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_palette_roles,node_p3_conversion,node_consumer toneBlue
class node_theme_mapping,node_build,node_theme_json toneAmber
class node_package_entry toneMint
class node_vscode,node_shiki toneIndigo
```

## Components

### Palette and color

- [Light/dark roles](https://github.com/twbs/bootstrap-vscode-theme/blob/main/src/palette.ts): `src/palette.ts`
- [P3 conversion](https://github.com/twbs/bootstrap-vscode-theme/blob/main/src/color-p3.ts): `src/color-p3.ts`

### Theme generation

- [UI and syntax mapping](https://github.com/twbs/bootstrap-vscode-theme/blob/main/src/theme.ts): `src/theme.ts`
- [Theme build](https://github.com/twbs/bootstrap-vscode-theme/blob/main/src/build.ts): `src/build.ts`
- **Four theme JSONs**

### Theme consumption

- [Theme exports](https://github.com/twbs/bootstrap-vscode-theme/blob/main/index.js): `index.js`

### Other components

- **Theme user**
- **VS Code**
- **Shiki tools**

## Connections

- Theme build → Light/dark roles: imports roles (evidence: `src/build.ts`)
- Theme build → P3 conversion: converts roles (evidence: `src/build.ts`)
- Theme build → UI and syntax mapping: builds themes (evidence: `src/build.ts`)
- Theme build → Four theme JSONs: writes files (evidence: `src/build.ts`)
- Theme exports → Four theme JSONs: imports themes (evidence: `index.js`)
- Theme user → Theme exports: imports package
- Theme user → VS Code: selects theme (evidence: `README.md`)
- Theme user → Shiki tools: uses themes (evidence: `README.md`)
