| 1 |
# theme-common — Architecture |
| 2 |
|
| 3 |
Shared TOML theme loading for GO, BB, and AF. |
| 4 |
|
| 5 |
## What It Does |
| 6 |
|
| 7 |
Parses TOML theme files with `[meta]`, `[background]`, `[foreground]`, `[accent]`, `[border]` sections. Provides metadata extraction, color flattening, filesystem scanning, import/export, and ID validation. |
| 8 |
|
| 9 |
## Consumers |
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
| GO, BB | `list_themes_from_dirs`, `load_theme`, `import_theme`, `export_theme` (runtime filesystem) | |
| 14 |
| AF | `ThemeMeta`, `parse_meta`, `extract_colors` (compile-time embedded themes) | |
| 15 |
|
| 16 |
## Key Types |
| 17 |
|
| 18 |
- `ThemeMeta` — id, name, variant, is_custom |
| 19 |
- `ThemeColors` — metadata + flattened color map (`background.primary` etc.) |
| 20 |
|
| 21 |
## Key Paths |
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
| All code | `src/lib.rs` (single file, ~585 lines including tests) | |
| 26 |
| Theme files | `../themes/*.toml` (16 bundled themes) | |
| 27 |
|