feat: implement dynamic theme loading and detection logic

added styles for ytm
This commit is contained in:
2026-02-14 09:09:33 +05:30
parent c992ca8595
commit e97559b7be
8 changed files with 342 additions and 65 deletions

View File

@@ -1,5 +1,24 @@
# Borlander
Borlander is a MV3 browser extension that applies a classic Borland blue/yellow theme globally, with optional site-specific overrides.
## Site-specific themes (automatic)
Any folder under `borlander/sites/<site>/styles.css` is treated as a site theme automatically.
* If the folder name looks like a hostname (e.g. `github.com`), it matches when the current page hostname includes that string.
* A couple themes are **heuristic-based** (currently `sonarr.local`, `gitea.local`) because they may run on custom domains. Those are defined in `borlander/scripts/generate-themes.mjs`.
The registry lives in `borlander/themes.json` and is loaded by both `content.js` and `popup.js`.
### Regenerate `themes.json`
If you add/remove site themes in `borlander/sites/`, re-generate the registry:
```fish
node borlander/scripts/generate-themes.mjs
```
#### Monkeytype theme