This document provides a comprehensive overview of the Sprinkles VSCode theme project for AI agents.
Sprinkles is a VSCode color theme extension featuring vibrant syntax highlighting with carefully curated color palettes. It provides both dark and light theme variants with a unique "sprinkled" aesthetic inspired by colorful sprinkles on donuts.
- Dark, light and cream theme variants
- Comprehensive syntax highlighting for multiple languages
- Carefully designed UI colors for VSCode interface elements
- Terminal color customization
- Git diff gutter indicators
sprinkles-vscode/
├── src/ # Source code
│ ├── colors/ # Color palette definitions
│ │ ├── index.ts # Color loader/selector
│ │ ├── cream.ts # Cream theme color palette
│ │ ├── dark.ts # Dark theme color palette
│ │ └── light.ts # Light theme color palette
│ ├── theme.ts # Theme generator (main logic)
│ └── index.ts # Build script entry point
├── themes/ # Generated theme JSON files (output)
│ ├── sprinkles-cream.json
│ ├── sprinkles-dark.json
│ └── sprinkles-light.json
├── images/ # Extension assets (icon)
├── .vscode/ # VSCode configuration
│ └── launch.json # Debug configuration
└── package.json # Extension manifest & build config
┌─────────────────┐
│ src/index.ts │ Entry point - orchestrates theme generation
└────────┬────────┘
│
▼
┌─────────────────┐
│ src/theme.ts │ Theme generator - creates VSCode theme structure
└────────┬────────┘
│
▼
┌──────────────────┐
│ src/colors/*.ts │ Color palettes - defines color schemes
└──────────────────┘
│
▼
┌──────────────────┐
│ themes/*.json │ Output - VSCode theme files
└──────────────────┘
- Entry point for theme generation
- Creates
themes/directory if it doesn't exist - Generates dark, light and cream theme JSON files
- Writes formatted JSON output with proper error handling
- Core theme logic
- Maps color palettes to VSCode theme properties
- Defines token scopes for syntax highlighting
- Returns complete VSCode theme object with:
- Editor colors (background, foreground, cursor, etc.)
- UI colors (activity bar, sidebar, status bar, etc.)
- Terminal ANSI colors
- Token colors (syntax highlighting rules)
index.ts: Exports color getter function based on variantdark.ts: Dark theme color definitionslight.ts: Light theme color definitionscream.ts: Cream theme color definitions- Color structure includes:
- Canvas colors (UI elements)
- Editor colors (code editor specific)
- Terminal colors (ANSI color mappings)
- Token colors (syntax highlighting)
- VSCode extension manifest
- Declares two theme contributions (dark and light)
- Defines build scripts and dependencies
- Extension metadata (name, version, publisher, etc.)
- TypeScript: Primary language
- Node.js: Runtime environment
- ts-node: TypeScript execution without compilation
- nodemon: Development file watcher
- vsce: VSCode Extension packager
- Prettier: Code formatting
- Husky: Git hooks for code quality
npm installGenerate theme JSON files from source:
npm run buildThis executes ts-node ./src/index.ts which:
- Reads color definitions from
src/colors/ - Generates theme objects via
src/theme.ts - Writes
themes/sprinkles-dark.jsonandthemes/sprinkles-light.json
Auto-rebuild themes on file changes:
npm run devUses nodemon to watch src/ directory and rebuild on changes.
- Open project in VSCode
- Press
F5or go to Run & Debug panel - Select "Extension" configuration
- Click "Start Debugging"
- A new VSCode window opens with the extension loaded
- Open Command Palette (
Cmd+Shift+PorCtrl+Shift+P) - Select "Preferences: Color Theme"
- Choose "Sprinkles Dark" or "Sprinkles Light"
npm run lint
npx prettier --write .-
Using VSCode Debugger:
- Configuration is in
.vscode/launch.json - Type:
extensionHost(launches VSCode Extension Host) - Press
F5to start debugging - Set breakpoints won't work (no runtime code, just JSON generation)
- Configuration is in
-
Theme Generation:
# Add console.log statements in src/index.ts or src/theme.ts npm run build # Or use Node debugger node --inspect-brk ./node_modules/.bin/ts-node ./src/index.ts
-
Theme Output:
- Inspect generated files:
themes/sprinkles-dark.json - Use VSCode Developer Tools in extension host:
Help > Toggle Developer Tools - Check theme token inspector:
Developer: Inspect Editor Tokens and Scopes
- Inspect generated files:
Theme not updating in extension host:
- Reload the extension host window (
Cmd+RorCtrl+R) - Or restart the debug session
Colors not appearing correctly:
- Check generated JSON files in
themes/directory - Verify color definitions in
src/colors/dark.tsorlight.ts - Use token inspector to see applied scopes
Build errors:
- Ensure TypeScript files have no syntax errors
- Check that all color properties are properly defined
- Verify color values are valid hex codes
-
Edit color palettes:
- Dark:
src/colors/dark.ts - Light:
src/colors/light.ts - Cream:
src/colors/cream.ts
- Dark:
-
Rebuild:
npm run build
-
Test in extension host (F5)
- Edit
src/theme.ts - Locate
tokenColorsarray - Add/modify scope rules:
{ name: "My Custom Token", scope: ["source.js meta.class"], settings: { foreground: colors.editor.tokens.amber, fontStyle: "italic" } }
- Rebuild and test
- Edit
colorsobject insrc/theme.ts - Find VSCode theme key (e.g.,
"activityBar.background") - Map to color from palette
- Rebuild and test
npm run publish:vsceRequires publisher credentials configured with vsce.