T1: bundle IBM Plex Mono as the code font, italic comments (D28)
Daniel chose IBM Plex Mono from Amy's comparison of four free fonts. It ships from @fontsource (Latin and Latin Extended, 400/700 with italics) and leads font-mono for the editor and the terminal; the UI keeps the system font. OFL-1.1 is allowed for this one package only (PACKAGE_EXCEPTIONS in xtask/src/licences.rs, comment in deny.toml). NOTICE, ASSETS.md and docs/themes.md updated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
d81c943905
commit
f2a1ef12cd
13 changed files with 70 additions and 17 deletions
|
|
@ -1,6 +1,6 @@
|
|||
# Themes
|
||||
|
||||
> **Status:** six built-in themes, theme files with import, editor font settings (C9 T1) · **Last updated:** 2026-11-02
|
||||
> **Status:** six built-in themes, theme files with import, editor font settings, bundled code font IBM Plex Mono (C9 T1) · **Last updated:** 2026-11-06
|
||||
|
||||
Every colour and font in Lutra comes from theme tokens: CSS custom properties `--lt-<name>` that `crates/engine/src/theme.rs` defines and the UI reads with `var(--lt-…)`. Nothing in the UI hard-codes a colour.
|
||||
|
||||
|
|
@ -30,7 +30,7 @@ The **Editor** section of the settings has three font settings. They apply live
|
|||
|
||||
| Setting | Default | Meaning |
|
||||
|---|---|---|
|
||||
| `editor.fontFamily` | empty | A CSS font list such as `"JetBrains Mono", monospace`. Empty uses Lutra's monospace stack (`ui-monospace, "Cascadia Code", Menlo, Consolas, monospace`), which also stays behind your choice as a fallback. The font must be installed. The characters `; { } < > \` are refused. Applies to the editor and other code text at once, and to terminals opened afterwards (it drives `--lt-font-mono`). |
|
||||
| `editor.fontFamily` | empty | A CSS font list such as `"Fira Code", monospace`. Empty uses Lutra's own code font, IBM Plex Mono, which ships with Lutra (regular, bold and italic; comments are set in its italic). The default stack (`"IBM Plex Mono", ui-monospace, "Cascadia Code", Menlo, Consolas, monospace`) also stays behind your choice as a fallback. Any other font must be installed. The characters `; { } < > \` are refused. Applies to the editor and other code text at once, and to terminals opened afterwards (it drives `--lt-font-mono`). |
|
||||
| `editor.fontSize` | 14 | Size in pixels, 8 to 48. |
|
||||
| `editor.lineHeight` | 150 | Line height in percent of the font size, 100 to 300. |
|
||||
|
||||
|
|
@ -149,10 +149,11 @@ Lutra does not check the contrast of an imported theme. To check it the way the
|
|||
- A built-in theme is a `Theme` constant in `crates/engine/src/theme.rs`, listed in `BUILTIN`, with its name in `ui/src/i18n/en.json` (`theme.<camelId>` and `settings.appearance.theme.value.<camelId>`).
|
||||
- Every built-in theme defines exactly the tokens of `DARK` (a Rust test checks it). After changing a token, run the engine tests with `LUTRA_UPDATE_SNAPSHOTS=1` to rewrite `ui/tests/theme/themes.json`. The Vitest contrast test reads that file.
|
||||
- A new token needs a value in every theme, a row above, and a contrast pair in `contrast.test.ts` if text or marks are drawn with it.
|
||||
- Bundling JetBrains Mono as the default (waiting for the owner to approve OFL-1.1 in `xtask/src/licences.rs` and `deny.toml`) takes three steps: add `@fontsource/jetbrains-mono` to `ui/package.json` and import it in `ui/src/main.ts`; put `"JetBrains Mono"` first in `font-mono` (`COMMON` in `theme.rs`) and in `MONO_FALLBACK` (`ui/src/stores/settings.ts`); then update the default described above.
|
||||
- The code font IBM Plex Mono comes from `@fontsource/ibm-plex-mono` (Latin and Latin Extended, 400 and 700 with italics, about 118 KB), imported in `ui/src/main.ts`, and leads `font-mono` (`COMMON` in `theme.rs`) and `MONO_FALLBACK` (`ui/src/stores/settings.ts`). Daniel chose it from four candidates Amy compared (D28); OFL-1.1 is allowed for this package only (`PACKAGE_EXCEPTIONS` in `xtask/src/licences.rs`, comment in `deny.toml`). The UI font stays the system font.
|
||||
|
||||
## Revision history
|
||||
|
||||
| Date | Change | Summary |
|
||||
|---|---|---|
|
||||
| 2026-11-06 | minor | IBM Plex Mono bundled as the code font, italic comments (D28) |
|
||||
| 2026-11-02 | major | First version: four new built-in themes, theme file format and import, editor font settings (C9 T1) |
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
- [ ] Light and dark themes from theme tokens
|
||||
- M1.10 (2026-10-16): Lutra Dark and Lutra Light from Rust tokens, switched live through `appearance.theme` (no reload), `system` follows the OS preference, the first frame uses the stored theme; the editor (selection, active line, cursor, gutter, matches), tabs and notices have their own tokens; WCAG AA contrast checked by Vitest for every text pair in both themes. Covered by Vitest DOM and control-channel tests; live check pending (gaming mode). M1.9b: theme picker in the settings dialog, editor font size from `editor.fontSize`. Missing: the native title bar following the theme, colour scheme editor, high-contrast theme (the palette command came with C9 T1).
|
||||
- H5 (2026-10-25): both themes follow the README banner, approved by the owner from before/after screenshots (tree, PHP editor, Problems, terminal, palette, settings; Windows 11, bundled UI, control port 7955): cream-tinted light theme, faintly plum-tinted dark theme, raspberry only as the accent, retuned syntax colours, the terminal on the editor surface. Diagnostics get their own colours (`--lt-diag-*`: error, amber warning, blue info, muted hint) in the underline, gutter dot, tooltip stripe and Problems icon; `--lt-vcs-*` status colours for M4.4; completion kind icons coloured by kind. Every text colour ≥ 4.5:1 and icon colour ≥ 3:1 in both themes (Vitest contrast test).
|
||||
- C9 T1 (2026-11-02): four more built-in themes designed by Amy and approved by the owner: Plum Night and River (dark), Paper and Reed (light), each with the full token set and AA contrast checked by the Vitest contrast test. "Select Theme…" (`view.selectTheme`, View menu, palette) opens a picker that previews live while moving and restores on Escape; `theme.select`, `theme.current` and `theme.list` serve agents. Theme files (JSON, every colour token, validated; `docs/themes.md`) come in through "Import Theme…" (`view.importTheme`) or `theme.import`, are stored in Lutra's data directory and appear in the picker and the settings; a broken file gives the reason, a broken stored file is skipped with a warning. Editor font family and line height settings join the font size, all live. Missing: a colour scheme editor, exporting and removing themes in the UI, per-token font styles, a high-contrast theme, a bundled JetBrains Mono (needs the OFL licence approved for the frontend check).
|
||||
- C9 T1 (2026-11-02): four more built-in themes designed by Amy and approved by the owner: Plum Night and River (dark), Paper and Reed (light), each with the full token set and AA contrast checked by the Vitest contrast test. "Select Theme…" (`view.selectTheme`, View menu, palette) opens a picker that previews live while moving and restores on Escape; `theme.select`, `theme.current` and `theme.list` serve agents. Theme files (JSON, every colour token, validated; `docs/themes.md`) come in through "Import Theme…" (`view.importTheme`) or `theme.import`, are stored in Lutra's data directory and appear in the picker and the settings; a broken file gives the reason, a broken stored file is skipped with a warning. Editor font family and line height settings join the font size, all live. Missing: a colour scheme editor, exporting and removing themes in the UI, per-token font styles, a high-contrast theme. Lutra's own code font, IBM Plex Mono (owner's choice, D28), ships for the editor and the terminal, with italic comments.
|
||||
- [ ] Notifications and background task indicator
|
||||
- M1.12 (2026-10-16): toasts at the bottom right for engine and host notifications (corrupt settings and journal entries at startup, folder that cannot be opened, `unsaved_changes` when switching projects, file watching stopped, failed commands without their own UI): info dismissed after 5 s, warnings and errors stay until closed, close button and Escape, at most 5 visible with "+n more", `role="status"`/`role="alert"`; startup notifications are replayed when the page starts listening. Vitest (19 store and component tests); live check pending (gaming mode). Missing: a notification log / Notifications tool window, actions inside a toast, balloon grouping, "don't show again", background task indicator with progress.
|
||||
- [ ] Structure tool window
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue