Files
openidea/templates/theme-plugin/README.md
T
l0ng-ai 30310810e6 feat(plugins): Theme plugin template, theme docs and IntelliJ theme import (#54)
Per the maintainer's decision for #24, no third-party themes are bundled; instead a theme plugin template and docs let the community port themes (IntelliJ also ships few themes, the rest are plugins).
- templates/theme-plugin: manifest-only plugin with an original example (Harbor Night) covering every UI token and an editor scheme (.icls equivalent).
- docs/plugins/themes.md: format, IntelliJ / VS Code porting tables, generated token reference (pnpm gen:theme-docs); drift test fails when tokens.css and the template/reference disagree.
- pnpm theme:import-intellij: dependency-free converter for IntelliJ .theme.json (+ .icls).
- Plugin host: themes may name an editor-scheme merged over the theme; comments allowed in theme files.
- Fixes: a plugin theme's kind now switches the light/dark base; plugin themes go in their own stylesheet so the Appearance accent and editor scheme still layer on top.
Verified: ide-plugin tests, vitest (44), in-app on macOS: installed the template from disk, applied Harbor Night (dark base + teal accent over Islands Light), back to default restored the light theme.

Claude-Session: https://claude.ai/code/session_01VUYsdXA2nkF5v6zsC93dpn
2026-10-27 10:39:08 +08:00

54 lines
2.4 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Theme plugin template
A complete OpenIDEA theme plugin with one worked example, **Harbor Night**: a
dark theme with slate surfaces, a teal accent and a warm syntax palette. Copy
this folder to start your own theme. Full documentation, the token reference
and porting guides are in [`docs/plugins/themes.md`](../../docs/plugins/themes.md).
```
theme-plugin/
├─ plugin.toml # manifest: id, name, version, the theme files
└─ themes/
├─ harbor-night.theme.json # UI colours, every themeable token, grouped like tokens.css
└─ harbor-night.scheme.json # editor colour scheme: syntax, editor, ANSI colours
```
A theme plugin is data only: no code, no WebAssembly, no build step.
## Make your own
1. Copy the folder, for example to `~/openidea-themes/theme-my-theme`.
2. In `plugin.toml`, change `id` (lowercase, `a-z 0-9 - _`), `name`,
`description`, `authors` and the two paths.
3. Rename the theme files. In the theme file, set `id`, `name` and `kind`
(`"dark"` or `"light"`, the built-in base for anything you leave out).
4. Edit the colours. Each key is a CSS variable from `src/styles/tokens.css`,
and the reference in the docs gives the Islands Dark and Light values.
Comments (`//`, `/* */`) are allowed. Delete a line to keep the built-in value.
Porting an IntelliJ theme? `pnpm theme:import-intellij <file.theme.json> [file.icls] --out <dir>`
in the OpenIDEA repository generates a package in this layout.
## Package and install
The folder is the package. To share it, publish the folder as a Git repository
or a zip that users extract.
1. In OpenIDEA open **Settings › Plugins**, click the gear menu and choose
**Install Plugin from Disk…** (or run the *Install Plugin from Disk…*
action), then pick the folder that contains `plugin.toml`.
2. Select the plugin in the *Installed* tab and press **Apply** next to the theme.
3. **Use Default Theme** in the same place goes back to the built-in theme.
## Iterate
Put (or symlink) the folder in `<project>/.openidea/plugins/` of an open
project. It loads as a *dev* plugin, and **Reload** in Settings › Plugins (or
the *Reload Plugins* action) re-reads your edits without reinstalling. Invalid
JSON or values are reported in Settings › Plugins with the file and line.
## Licence
The template and Harbor Night are part of OpenIDEA (Apache-2.0). When you port
someone else's theme, keep its licence and credit its authors.