diff ref struct Rietveld refinement for the Mac · powder diffraction with X-rays, synchrotron and neutrons · started October 2026

Themes and skins for the app’s appearance

Themes and skins for the app's appearance discussed

I01 · an idea of the seed-place, on its way to the app.

Said
2026-10-15, Josu
Status
discussed
Home
app (where it migrates)
Needs
none

The idea

The option to choose a theme, a skin, for the app's appearance, as the forks of VS Code offer: not only light and dark, but named looks a user picks, shares and installs.

Assessment

What exists. The app already declares every colour as a token: 46 custom properties on :root in app/ui/style.css (the background, the panels, the ink, the lines, the plot's observed, calculated and difference colours, the accent, the phases' colours), each with a light and a dark value; light, dark and automatic are chosen in View ▸ Appearance and Settings ▸ Appearance; the system's accent colour is read; the plot reads the theme's colours again on a change (app/README.md, 0.38.0; DESIGN.md §6, C10). A theme is therefore a named set of values for tokens that already exist, and the views need no change to take it.

What it gives. A user's own look, and a way to share one: a laboratory's theme, a high-contrast theme for a projector, a theme that matches a thesis's figures on screen. For the editor, the syntax colours of the control file (CodeMirror) come from the same file.

What it costs. Little in code: a reader of theme files, a list in Settings ▸ Appearance, a folder in ~/Library/Application Support/eus.ehu.diffrefstruct/themes/. The cost is in the rules that keep a theme right, and they are three.

  • A theme is two columns, light and dark, never one: the app follows the system and a theme must follow with it (C10). A theme that gives one column is applied to both and said to be so.
  • The plot's colours are part of a theme, but their meaning is not: observed, calculated and difference keep their roles, the colours stay distinguishable to a colour-blind reader, and nothing is conveyed by colour alone (C10). The check of a theme, contrast ratios and the distance between the plot's colours, is a calculation; by L139 every calculation is the core's. Whether this one is, or is the one the app may do because it is about pixels and nothing else, is for Josu (ask 2).
  • Publish's figures never follow the app's theme. They follow the preset, journal or university, in LaTeX (L103, L258). A theme is for the screen.

What VS Code and its forks do (its documentation; the format is public). A theme is an extension with no code: a JSON of colors (the workbench's) and tokenColors (the syntax's), published on the marketplace; the forks (Cursor, TRAE, VSCodium) take the same format. Thousands exist. Our tokens are not VS Code's, but the editor's syntax colours map one to one, and the workbench's map approximately (background, foreground, the sidebar, the activity bar, the status bar), so a VS Code theme can be imported with its mapping stated.

Proposal

  • Step 1. A theme file of our own: one JSON per theme in the themes folder, every token of style.css with a light and a dark value, a name and an author; two bundled, the present look ("Paper") and a high-contrast one; Settings ▸ Appearance lists them, a change applies at once (C4). The self-check loads each bundled theme and reads every token back.
  • Step 2. The editor's syntax colours from the theme, through CodeMirror's theme extension.
  • Step 3. A VS Code theme imported: its colors and tokenColors mapped onto our tokens, the tokens it does not set kept from "Paper", the mapping printed in the Settings pane.
  • Step 4. When I02 exists, a theme is an extension that carries no code: the first package installed through the extension machinery, which tests search, install, enable and disable without running anything.

For Josu to decide

  • Whether a theme is only colours, or also the views' font and size (both are tokens today).
  • Where a theme's check lives: in the core (L139 read strictly: every calculation is the core's), or in the app as the one computation that is about pixels only.
  • Whether a theme file is JSON or the control file's syntax (a strict subset of TOML, L066), for one syntax across the app's files.

The idea's log

  • 2026-10-15 · said

    Said by Josu in the ideas chat: themes and skins, as the forks of VS Code offer.

  • 2026-10-15 · discussion

    Assessed: the app's 46 colour tokens, light and dark, and the Appearance settings already carry it; the cost is the three rules (two columns, the plot's meaning and colour-blind safety, Publish never follows the screen). A theme as a code-less extension once I02 exists. L288