feat(themes): Solarized and One theme plugins; plugin themes from the first frame

Add two contribution-only theme plugins, each with a light and a dark theme
that sets every UI token plus an editor colour scheme with syntax, editor
and terminal ANSI colours:

- plugins/theme-solarized: Solarized Light, Solarized Dark
- plugins/theme-one: One Light, One Dark (Atom One, original HSL values)

They replace the partial theme-solarized-dark sample. Each package ships
the MIT notice of its palette in LICENSE, which is now copied on install
with the files the manifest references. scripts/theme checks every theme
plugin in plugins/ against the token list of tokens.css.

Theme handling that any theme benefits from:

- Start-up: boot.js restores the selected plugin theme's stylesheet and the
  last resolved frame, text and accent colours before any CSS loads, so the
  splash and workbench no longer show the built-in theme until the plugin
  host answers. The UI keeps the boot theme until the first plugin list,
  and the list now waits for the initial plugin load.
- Native windows: the UI reports the plugin theme's resolved frame colour,
  which the plugin host persists and new project windows open in.
- hsl(), color-mix() and var() tokens are resolved to RGB for Tauri's window
  background, the native Settings window (hex) and Mermaid diagrams.
- Mermaid, the terminal and the editor colour scheme follow switches between
  plugin themes of the same light / dark base; an explicit editor scheme
  now replaces a plugin theme's editor colours.

Supersedes #85.

Co-authored-by: bghtyu <[email protected]>
Claude-Session: https://claude.ai/code/session_01VUYsdXA2nkF5v6zsC93dpn
Цей коміт міститься в:
l0ng-aiтаbghtyu committed 2026-10-27 17:50:44 +08:00
1 джерело 866af3d9cb
коміт b424cb32a8
43 files changed
+2035 -180

No files matched your search

+28 -2
Переглянути файл
@@ -16,6 +16,31 @@ my-theme/
└─ my-theme.scheme.json # editor colours, optional (IntelliJ: .icls)
```
## Ready-made theme plugins
The repository's [`plugins/`](../../plugins) folder holds two complete theme
plugins, each with a light and a dark theme and an editor colour scheme
(syntax, editor and terminal ANSI colours):
| Package | Themes | Palette |
|---|---|---|
| [`plugins/theme-solarized`](../../plugins/theme-solarized) | Solarized Light, Solarized Dark | [Solarized](https://github.com/altercation/solarized) by Ethan Schoonover |
| [`plugins/theme-one`](../../plugins/theme-one) | One Light, One Dark | Atom [One Light](https://github.com/atom/one-light-syntax) / [One Dark](https://github.com/atom/one-dark-syntax) by GitHub |
Both palettes are MIT-licensed; each package carries the notice in its
`LICENSE`, which is installed with it. To use one:
1. *Settings › Plugins › ⚙ › Install Plugin from Disk…* and pick the package
folder (`plugins/theme-solarized` or `plugins/theme-one` of a checkout or a
downloaded copy). Development builds also list both on the *Available*
tab, where *Install* does the same.
2. Select the plugin and press *Apply* next to a theme.
The IDE remembers the theme: the next start-up opens its windows, splash and
workbench in the theme's colours before the plugin host has loaded.
## Writing a theme plugin
The quickest way to start is to copy [`templates/theme-plugin`](../../templates/theme-plugin).
It contains *Harbor Night*, a complete example dark theme that sets every
themeable token. The rest of this page covers the file format, the token
@@ -282,8 +307,9 @@ A `fontStyle: "italic"` on comments maps to `"--syn-comment-style": "italic"`.
- Text should keep at least WCAG AA contrast (4.5:1) on its surfaces. The
built-in themes are checked by `src/features/settings/__tests__/contrast.test.ts`.
- Repository checks (for changes to this repo): `pnpm vitest run scripts/theme`
validates the template against tokens.css and keeps this reference current,
and `cargo test -p ide-plugin` loads the template through the plugin host.
validates the template and the theme plugins in `plugins/` against
tokens.css and keeps this reference current, and `cargo test -p ide-plugin`
loads them through the plugin host.
## Token reference