-
Notifications
You must be signed in to change notification settings - Fork 0
Developer Themes
github-actions[bot] edited this page May 22, 2026
·
1 revision
BLXCode themes are CSS custom properties switched at runtime via html[data-theme]. No backend involvement.
| Path | Role |
|---|---|
themes/tokens.css |
Token definitions per theme ([data-theme="…"]) |
styles.css |
Layout rules consuming var(--*)
|
src/theme/catalog.rs |
AppTheme metadata (id, mode, preview colors) |
src/theme/i18n.rs |
Maps theme id → I18nKey for name/description |
src/workbench/theme_service.rs |
ThemeService: persist, apply, dispatch event |
src/workbench/appearance_settings_pane/ |
Settings UI |
index.html |
Anti-flash boot script + CSS load order |
public/terminal_bootstrap.mjs |
xterm palette from computed tokens |
frontend-js/graph3d_entry.mjs |
3D graph colors + theme listener |
src/workbench/memory_graph/mod.rs |
2D SVG reads tokens via getComputedStyle
|
index.html boot script
-> document.documentElement.dataset.theme
themes/tokens.css (before styles.css)
-> [data-theme] { --bg-app, --accent, … }
ThemeService::set_theme (App root context)
-> localStorage blxcode_theme_v1
-> dataset.theme
-> CustomEvent blxcode-theme-changed
terminal_bootstrap.mjs / graph3d_entry.mjs
-> refresh instances from getComputedStyle
ThemeService is provided in src/app.rs (same level as I18nService) so EULA and boot screens inherit the active theme.
- Add an
AppThemeentry insrc/theme/catalog.rs(includeThemePreviewColors). - Add
ThemeName*/ThemeDesc*keys tosrc/i18n/keys.rsand all locale files. - Add
theme_name_key/theme_desc_keyarms insrc/theme/i18n.rs. - Add a
[data-theme="your-id"]block inthemes/tokens.csswith all extended tokens (overlays, terminal, agent accents, git lanes, semantic colors). - Register the id in the boot script
VALIDmap inindex.html. - Extend xterm / graph theme maps if you add new token names (prefer reusing existing tokens).
Default theme id: blxcode-dark (DEFAULT_THEME_ID).
- Use semantic tokens (
--accent,--overlay-2,--danger, …) — not raw hex in component CSS. - Component CSS lives beside components; global tokens live in
themes/tokens.css. - No
var(--token, #fallback)literals insrc/**/*.css. - Run
scripts/lint_theme_tokens.shbefore merge. - See
.agents/rules/rule-theme-tokens.md.
scripts/tokenize_styles_css.py replaces hardcoded colors in styles.css with var(--*) references. Re-run after large CSS edits.
Surfaces that cannot follow data-theme are documented in THEME_EXCEPTIONS.md.
Appearance chrome uses keys such as AppearanceHeroTitle, AppearanceFilterDark, etc. Theme catalog strings use paired ThemeName* / ThemeDesc* keys per theme id. Regenerate missing locale rows with:
python scripts/tools/render_i18n_locales_from_en.py- User-Agent-Harness
- User-Agent-Providers
- User-Appearance-Themes
- User-Building
- User-Getting-Started
- User-Image
- User-Keyboard-Shortcuts
- User-Language
- User-Memory-And-Tasks
- User-Plans
- User-Rules-And-Skills
- User-Settings
- User-Subagents
- User-Troubleshooting
- User-Voice
- User-Workspaces
- Developer-Agent-Harness
- Developer-Architecture
- Developer-Contributing
- Developer-I18n
- Developer-Setup
- Developer-Subagents
- Developer-Tauri-Ipc
- Developer-Themes
- Developer-Voice