### Simple branding (version 1) | Field | Type | Required | Rules | |---|---|---|---| | `platformName` | string | no | 1 to 64 characters | | `tagline` | string | no | at most 160 characters | | `logoUrl`, `logoDarkUrl`, `faviconUrl` | string or null | no | a relative path served by the installation, such as `/branding/logo.png` | | `primaryColor` | string | yes | `#rrggbb`, becomes the accent | | `secondaryColor` | string | yes | `#rrggbb`, becomes the primary button colour | | `loginBackgroundColor` | string or null | no | `#rrggbb` | | `defaultTheme` | string | no | `light`, `dark`, `midnight`, `high-contrast` | Use version 2 for new work. ### Locale overlay A `locale` item renames UI strings: `{ "locale": "de", "keys": { "": "" } }`. | Field | Rules | |---|---| | `locale` | `en`, `de`, `es` or `ar` | | `keys` | 1 to 2000 entries. Each key must be an existing UI string key. Each value at most 500 characters | Values cannot contain `<` or `>` or the names of third-party products. Keys starting with `_meta` are not overridable. Placeholders such as `{{count}}` must match the original string. A locale overlay applies to the whole installation: use install scope, one overlay per locale. Every English UI key with its stock text: [locale-keys-en.json](https://aancer.ai/dev/manual/theme/locale-keys-en.json) (the full catalog for overlays) and [locale-keys-en.md](https://aancer.ai/dev/manual/theme/locale-keys-en.md) (the same keys as a readable list). ## Full examples ### Theme with a font and logos, scoped to one workspace, plus a locale overlay for the installation `manifest.json`: ```json { "v": 2, "kind": "bundle", "id": "acme.workspace-ci", "version": "1.0.0", "title": "Acme workspace identity", "publisher": { "name": "Acme Example Ltd", "keyId": "pub-0123456789ab" }, "requires": { "platform": ">=1.0.0" }, "parameters": [ { "id": "target_workspace", "type": "workspace", "label": "Workspace", "required": true } ], "items": [ { "kind": "theme", "schemaVersion": 2, "id": "acme-ws-ci", "scope": "workspace", "workspace": "{{param.target_workspace}}", "spec": { "$ref": "content/theme.json" } }, { "kind": "locale", "schemaVersion": 1, "id": "de-words", "scope": "install", "spec": { "locale": "de", "keys": { "nav.knowledge": "Wissen" } } } ] } ``` `content/theme.json`: ```json { "id": "acme-ws-ci", "platformName": "Acme", "tagline": "Your data. Your AI.", "defaultTheme": "light", "fonts": [ { "family": "Acme Sans", "src": "content/fonts/acme-sans.woff2", "weight": "400 700", "style": "normal", "display": "swap" } ], "typography": { "ui": "'Acme Sans', system-ui, sans-serif", "display": "'Acme Sans', system-ui, sans-serif" }, "themes": { "light": { "--bg": "#ffffff", "--s0": "#f3f6f7", "--s1": "#ffffff", "--s2": "#ffffff", "--s3": "#f3f6f7", "--s4": "#e6ecee", "--t0": "#14232a", "--t1": "#3c4f57", "--t2": "#5b6c73", "--ac": "#0f6e74", "--aci": "#ffffff", "--acs": "#e3f2f2", "--acb": "rgba(15,110,116,0.30)", "--pr": "#14232a", "--prs": "#e9eef0", "--prb": "rgba(20,35,42,0.30)", "--b": "#d3dcdf", "--bm": "#b8c5ca", "--bs": "#8a9aa0", "--scrollbar": "#b8c5ca", "--anchor": "#14232a", "--anchor-raised": "#22343c", "--ink-on-anchor": "#ffffff", "--ink-on-anchor-dim": "#c3cfd3", "--shadow-card": "0 1px 3px rgba(20,35,42,0.08), 0 4px 14px rgba(20,35,42,0.06)" }, "dark": { "--bg": "#0f1a1f", "--s0": "#0a1317", "--s1": "#0f1a1f", "--s2": "#17252b", "--s3": "#1f2f36", "--s4": "#2a3c44", "--t0": "#eef3f4", "--t1": "#c3cfd3", "--t2": "#9fb0b6", "--ac": "#5cc6c9", "--aci": "#0a1317", "--acs": "#12343a", "--acb": "rgba(92,198,201,0.35)", "--pr": "#c3cfd3", "--prs": "#1f2f36", "--prb": "rgba(195,207,211,0.35)", "--b": "#2a3c44", "--bm": "#3a4f58", "--bs": "#4e646d", "--scrollbar": "#3a4f58", "--anchor": "#081014", "--anchor-raised": "#1f2f36", "--ink-on-anchor": "#eef3f4", "--ink-on-anchor-dim": "#9fb0b6", "--shadow-card": "0 1px 3px rgba(0,0,0,0.45), 0 4px 14px rgba(0,0,0,0.3)" } }, "logos": { "light": "content/logos/logo.png", "dark": "content/logos/logo-dark.png", "favicon": "content/logos/mark.png" } } ``` The folder also holds `content/fonts/acme-sans.woff2`, `content/logos/logo.png`, `content/logos/logo-dark.png` and `content/logos/mark.png`. `login` and `email` are left out because they apply to install-scoped themes only. ## Install and test ### In the UI 1. **Platform Settings > Extensions > Trust keys > Add trust key**, once per publisher. 2. **Import pack**. The summary lists items, fonts, logos and contrast warnings. 3. **Activate**. Pick the workspace if the theme is workspace-scoped. 4. Reload the browser. Under **Platform Settings > Look & feel**, an administrator can switch between stock and imported themes, and offer themes for users to choose. Retiring the pack returns to the stock look, or to the manual branding if one was set. ### With the REST API | Call | Permission | |---|---| | `POST /api/extensions/packs/import` (raw bytes) | `extensions.manage` | | `POST /api/extensions/packs/{packId}/activate {version, parameters}` | `extensions.manage` (`extensions.manage_own` for workspace-only packs) | | `GET /api/extensions/themes` | lists stock and imported themes | | `POST /api/extensions/themes/apply {packId or null, version?}` | switch the active theme | | `PUT /api/extensions/themes/{packId}/offer {offered: true}` | let users choose it | | `PUT /api/appearance/me {packId or null}` | a user picks an offered theme (`appearance.choose`) | | `GET /api/branding` | public, the active branding | | `GET`, `PUT /api/admin/branding` | manual branding without a pack (`platform.configure_branding`) | While an install-scoped theme pack is active, manual branding is read-only. Test in an EVAL or test installation first: import shows every contrast warning before anything changes. ## Common errors | Message | Fix | |---|---| | external or inline resources are not allowed (no http, //, data:, url() anywhere) (`THEME_EXTERNAL_ASSET`) | Ship files in `content/`. Remove URLs and `//` from every text, including tagline and footer | | `/themes/`: unknown theme id | Use one of the seven block ids | | `/themes//`: not a themable token | Use a token from the table. Fonts go in `typography` | | colour must be #rgb, #rrggbb or rgba(r,g,b,a) | No `var()`, `hsl()` or names | | `/typography/`: font family '...' is not declared in fonts[] and is not a generic family | Declare the font in `fonts` | | must be a pack file under content/fonts or content/logos | Fix the path. Lower-case file names only | | fonts must live under content/fonts/ / logos must live under content/logos/ | Move the file | | `` is not in the pack (`PACK_SIGNATURE_INVALID`) | Add the file and sign again | | `` is not a woff2 font (`THEME_ASSET_MIME`) | Convert the font to woff2 | | ``: contains `