<!-- Generated by npm run gen:skill from tools/skill/theme/theme-xml.md - do not edit. -->

# The theme file

`gui/themes/<name>.xml`. Inherit `aurora.xml`, the reference token theme: it maps the components to their token looks.

```xml
<theme name="harbor" tokens="true" icon="x-collection" dialogShadow="false">
  <inherit href="aurora.xml"/>
  <tokens><radius-md>6px</radius-md></tokens>
  <colors>
    <color name="primary">#1d4ed8</color>
    <color name="on-primary">#ffffff</color>
    <!-- ... every seed below -->
  </colors>
</theme>
```

- `tokens="true"` on every theme with `<tokens>`, the dark one too: without it the contract check fails.
- `<tokens>`: the element name is the token, `<radius-md>` sets `--xios-radius-md`: names from `tokens.css`, or the knobs listed in `tools/check-token-contract.mjs` (INTENTIONAL). No `;{}` in a value.
- `<colors>`: `<color name="x">` sets `--xios-color-x`. Seeds: `primary`, `secondary`, `tertiary`, each with `on-<role>`; `background`, `surface`, `on-surface`; `error`, `on-error`, `warning`, `success`. Also `red`, `yellow` (some CSS falls back to them: same as error, warning) and `lightText`/`darkText`, `lightIcon`/`darkIcon` (picked by background darkness).
- A child merges with its parent: colors, tokens, fonts by name, `<components>` per tag and attribute, `icon`. List only changes.
- Fonts: `<fonts><font-face name="Inter" href="(css)" type="css"/></fonts>` and `<font-sans>'Inter', sans-serif</font-sans>` in `<tokens>`.
- `<components>` maps a tag to its look (`<button look="token"/>`), the one place look names are used; aurora's mapping is inherited. Theme-wide `--xc-*`: `<components><view><style>:root { --xc-input-radius: 8px; }</style></view></components>`.

## Dark variant

A theme that inherits the light one: dark `background`, `surface`, `on-surface`, a lighter `primary` with a dark `on-primary`, brighter state colors (and `red`, `yellow`), `darkIcon` as `primary`, and `<tokens><appearance>dark</appearance></tokens>` (dark date pickers). Check its contrast again.

## Register and preview

- In xios-core: `<theme name="harbor" xlink:actuate="onRequest" xlink:href="xios://core/gui/themes/harbor.xml"/>` in `config/system.xml` `<themes>`. Theme Studio saves to the Themes storage folder, registered by `name`.
- Preview: `npx http-server . -p 5459 -c-1` (root first), open `/tools/tester/visual-boot.html?app=/ui/Input/tests/specimen.xml&theme=harbor`, then other `ui/<Dir>/tests/specimen.xml`s. An unknown theme falls back silently: check `--xios-color-primary` resolves.
