Theme Architecture
Hone uses VSCode-compatible JSON themes for both workbench colors and syntax highlighting. Themes are applied at two levels and can be switched at runtime without restarting the IDE.
Theme Format
Themes use the standard VSCode JSON theme format, making it possible to import any existing VSCode theme directly.
{
"name": "Hone Dark",
"type": "dark",
"colors": {
"editor.background": "#1e1e1e",
"editor.foreground": "#d4d4d4",
"sideBar.background": "#252526",
"statusBar.background": "#007acc",
"activityBar.background": "#333333"
},
"tokenColors": [
{
"scope": ["keyword", "storage.type"],
"settings": {
"foreground": "#569cd6"
}
},
{
"scope": ["string"],
"settings": {
"foreground": "#ce9178"
}
}
]
}
Two-Layer System
UI Theme (Workbench Colors)
The colors object defines colors for every workbench element:
- Editor: background, foreground, line highlight, selection, cursor
- Sidebar: background, foreground, border
- Activity bar: background, foreground, badge
- Status bar: background, foreground (normal, debugging, no-folder)
- Tabs: active/inactive background and foreground, border
- Panel: background, border
- Title bar: background, foreground
- Input fields, dropdowns, buttons, scrollbars, minimap, etc.
Colors are accessed through getter functions:
getEditorBackground()
getEditorForeground()
getSideBarBackground()
getStatusBarBackground()
getActivityBarBackground()
getTabActiveBackground()
getTabInactiveBackground()
getPanelBackground()
// ... and many more
Token Theme (Syntax Highlighting)
The tokenColors array maps TextMate scopes to colors and font styles:
keyword– language keywords (if,else,return, etc.)string– string literalscomment– commentsvariable– variable namesfunction– function names and callstype– type names, classes, interfacesconstant– constants, numbers, booleansoperator– operatorspunctuation– brackets, semicolons, commas
Token scopes support dot-separated specificity (e.g., entity.name.function.typescript is more specific than entity.name.function).
Built-in Themes
15 themes ship with the IDE (hone-themes package):
| Theme | Type |
|---|---|
| Hone Dark | dark |
| Hone Light | light |
| Catppuccin | dark |
| Dracula | dark |
| GitHub Dark | dark |
| GitHub Light | light |
| Gruvbox Dark | dark |
| High Contrast Dark | dark (high contrast) |
| High Contrast Light | light (high contrast) |
| Monokai | dark |
| Nord | dark |
| One Dark | dark |
| Solarized Dark | dark |
| Solarized Light | light |
| Tokyo Night | dark |
WCAG Contrast Validation
The hone-themes package includes 452 tests (via Jest) that validate:
- Schema validation – every theme conforms to the expected JSON structure
- WCAG contrast ratios – text colors meet accessibility contrast requirements against their backgrounds
- Normal text: minimum 4.5:1 contrast ratio (AA)
- Large text: minimum 3:1 contrast ratio (AA)
- Required color keys – all themes define the minimum set of required colors
- Token color coverage – all themes provide colors for core syntax scopes
Run theme tests:
cd hone-themes && npm test
Importing VSCode Themes
Any VSCode JSON theme file can be imported directly:
- Place the
.jsontheme file in the themes directory - The theme engine reads and parses the VSCode format natively
- No conversion or transformation step is needed
This compatibility means the thousands of themes available in the VSCode ecosystem work in Hone out of the box.
Theme Application
When a theme is applied:
- The theme JSON is parsed and colors are resolved (including defaults for missing keys)
- Workbench colors are set on all UI elements via getter functions
- Token colors are compiled into a scope-to-style lookup table for the tokenizer
- The editor re-renders with the new colors
- The selected theme is persisted in user settings
Theme switching is instant – no restart required.