Appearance and custom colour themes
Choose light or dark and give the Petawork web app your own colours. Write a theme as YAML, save several, switch between them in Settings or through MCP tools, and clone a company's look from its website.
Settings → Appearance (/settings/appearance) is where you choose light, dark or system, and the colour theme you
see. A theme is a short YAML document. An organisation keeps up to 50 of them, and each member picks their own, so one
person can work in the company's colours while another stays on the built-in Petawork look.
What a theme changes
A theme sets the app's colour tokens: the page, panels, text, borders, the accent, primary buttons, headings, the status colours and the focus ring, in light and in dark. Fonts, spacing and layout do not change.
- It applies to every signed-in page: the console, Home, Notes, Tasks, People, Funnel, Agents, Studio and the rest.
- Petawork Notes follows light, dark or system too, and takes the theme's colours. Its graph keeps its own node colours, drawn deeper on a light page.
- Petawork Agents follows light, dark or system like every other page, and shows the theme's colours for that mode.
- Public pages (the website, these docs, the sign-in page, shared notes and forms) keep the built-in look.
- Light, dark and system work as before. The theme supplies the colours of whichever mode is showing.
The built-in look
Without a theme, Petawork uses its own brand: warm cream pages in light (#FDF8F3) and a warm near-black in dark
(#1B1814), never a cold grey or a pure black; navy (#1E3A5F, lightened to #9FBBDF in dark) as the accent and the
colour of page headings (cream in dark); primary buttons in the brand's teal (#2B6B6C, lightened to #6FB8A8 with
the dark page colour on it in dark); and the brand's teal, mustard and a brick red for success, warnings and errors. The app is set in Geist, headings
included, for readability; the Petawork wordmark and the website's headlines are in Playfair Display. Both fonts
ship with the app: nothing is loaded from a font service.
The system setting picks light or dark until you choose one in the account menu or here.
The theme is part of the page the server sends, so a themed page does not flash the built-in colours first.
The format
# A complete theme. Only name and, in each mode, bg, text and accent are required.
name: "Acme"
description: "The Acme brand, for the sales team"
light:
bg: "#ffffff" # the page
text: "#1a1a1a" # body text
accent: "#0f62fe" # links and highlights
panel: "#ffffff" # cards and tables
bg-subtle: "#f6f7f9" # the sidebar and quiet areas
muted: "#5f6368" # secondary text
faint: "#6f7378" # hints and placeholders
line: "#e3e5e8" # borders
line-strong: "#cdd0d5" # the borders of inputs and buttons
hover: "#f0f2f5" # a row under the pointer
active: "#e6e9ee" # a selected row
accent-fg: "#ffffff" # text on the accent
primary: "#0f62fe" # primary buttons
heading: "#0b2a5b" # page headings
ok: "#1b7a34" # status colours
info: "#0055bb"
warn: "#8a4500"
bad: "#b3261e"
focus: "#0f62fe" # the focus ring
dark:
bg: "#0b0d12"
text: "#e8eaed"
accent: "#78a9ff"| Key | Required | What it is |
|---|---|---|
name |
yes | What the theme is called, up to 60 characters. |
description |
no | One line, up to 200 characters. |
light, dark |
at least one | The colours of each mode. |
Inside light and dark:
| Colour | Required | Used for | Derived from, when left out |
|---|---|---|---|
bg |
yes | the page | |
text |
yes | body text | |
accent |
yes | links, highlights, the active marker | |
panel |
no | cards, tables, dialogs | bg (a step lighter in dark) |
bg-subtle |
no | the sidebar, footers of cards | bg, slightly toward text (toward black in dark) |
muted |
no | secondary text | a mix of text and bg, moved until it reads |
faint |
no | hints, placeholders | a lighter mix, moved until it reads |
line, line-strong |
no | borders | mixes of text and bg |
hover, active |
no | a row under the pointer, a selected row | mixes of text and bg |
accent-fg |
no | text on the accent | white or black, whichever reads better |
primary |
no | primary buttons (Save, Create, the main action of a page) | text, so the buttons look as they did before this key existed; the label on it is bg, or white or black when bg does not read |
heading |
no | page headings | text |
ok, info, warn, bad |
no | status colours | the built-in ones, moved until they read on bg |
focus |
no | the focus ring | the built-in one, moved until it shows on bg |
Everything else the app draws with is derived too: the soft backgrounds of badges, menus and their shadows, the overlay behind dialogs, the switch.
Rules:
- A colour is hex (
#0f62fe,#06f),rgb(),hsl()oroklch(). It is stored as six-digit hex. A colour with transparency is refused. - Put colours in quotes. A bare hex colour (
bg: #ffffff) is accepted too, although other YAML tools read a bare#as the start of a comment. - Give only
light(or onlydark) and the other mode is derived: a near-black page (or white), a near-white text (or near-black), and your accent moved until it reads there. Add the other block when you want to set it yourself. light.bgmust be a light colour anddark.bga dark one.- A key that is not in the tables above is an error that names it. Errors carry the line.
- The YAML is at most 16,384 characters. Your comments are kept.
Contrast is enforced
A theme that would be hard to read is refused, with the pair, both colours and the ratio. These are WCAG contrast ratios, checked on the colours you wrote and on the ones derived from them, in each mode:
| Colour | On | At least |
|---|---|---|
text |
bg and panel |
4.5:1 |
muted |
bg |
4.5:1 |
accent-fg |
accent |
4.5:1 |
| the primary button's label | primary |
4.5:1 |
heading |
bg |
4.5:1 |
accent |
bg |
3:1 |
ok, info, warn, bad |
bg |
3:1 |
faint, focus |
bg |
3:1 |
A refusal reads like this:
line 4: light.text (#9a9a9a) on light.bg (#ffffff) has contrast 2.8:1; at least 4.5:1 is needed. Pick a darker text.Colours that Petawork derives always pass, because they are moved until they do. Only a colour you set can fail.
Settings, Appearance
Every member can open the page.
- Light or dark is the same control as in the account menu. It is kept in the browser.
- Colour themes lists the built-in Petawork look and the organisation's saved themes. Each shows its light and dark colours, who made it and where it was cloned from. Use switches you to it at once. The one you use is marked.
- New theme opens the editor with a commented starter. It checks the YAML as you type, shows problems with their lines, and draws a preview with the candidate colours, in light and in dark, before anything is saved.
- Edit, Duplicate and Delete are in a theme's menu.
- Clone from a website is described below.
- ⌘K has Colour themes, which opens the page.
Who may do what:
| Viewer | Other members | The theme's maker, owners, admins | |
|---|---|---|---|
| See the themes, pick their own | yes | yes | yes |
| Create a theme, duplicate one | no | yes | yes |
| Edit or delete a theme | no | no | yes |
Deleting a theme sends everyone who used it back to the built-in look. Saving a change to a theme changes it for everyone who uses it, on their next page load.
Clone a website
Clone from a website takes a public address and proposes a theme from the site's colours. You see the YAML, the preview and a report before you save, and you can edit the YAML first.
What Petawork reads: the page, the stylesheets it links (on the site's own host or on another, such as a CDN), its
<style> blocks, the style attributes of html and body, and <meta name="theme-color">. Variables are followed
(var(--a) that points to var(--b)), and hex, rgb(), hsl(), oklch() and light-dark() are understood.
Each colour is picked by what it is for, not by the first name that matches:
| Colour | Where it comes from, strongest first |
|---|---|
bg |
The background declared on html, body or :root. Then a token named for the page background (--background, --bg, --color-bg-default, --bgColor-default). Then a neutral theme-color. Never a code highlighter's token (--shiki-…, --prism-…), an overlay's or one component's. |
text |
The colour declared on html or body. Then a token named for the main text (--foreground, --text-color, --color-text-primary, --fgColor-default). Never one named light, muted, subtle, secondary, disabled, placeholder, inverse or on a colour. A candidate that would not read on the background is rejected, and the report says so. |
accent |
A token named for the brand (--brand, --primary, --accent, --color-primary, --bs-primary, --button-primary-bg). Then the background of the page's buttons. Then a saturated theme-color. Then a token or a rule for links. Last, the saturated colour the stylesheets use most, weighted by where it is used (a button's background counts for more than a border or a shadow). |
muted, panel, line |
Only from a token named for it. |
ok, bad, warn, info |
Only from a token named for it whose value reads as that colour: a mid shade in the right hue. A pale tint (--red-50, --color-danger-100) is never used. When in doubt they are left out and derived. |
Some rules that follow from this:
- A token counts only when it is set for the whole page: on
:root,html,body, a theme switch (.dark,[data-theme="dark"]), or a class the page's ownhtmlorbodytag carries. A variable one component sets for itself is ignored. - A black and white brand stays black and white. When the site's buttons or solid blocks are near-black (near-white
in dark mode) and no saturated brand colour stands out, the accent is that neutral, and the report says which
saturated colour it passed over. Set
accentyourself if the brand has a colour. - Dark mode is read from
.dark,[data-theme="dark"],[data-color-mode="dark"]andprefers-color-scheme: darkblocks, from tokens whose value changes there, and from atheme-colorwith a darkmedia. A site with one mode gets the other derived.
The report says what was found and why it was chosen ("light.accent #635bff: the background of the page's buttons (.btn-primary in app.css), used 14 times"), what was guessed because the site did not say, and which colours were adjusted to pass the contrast rules above (from which colour to which). Its notes say how many stylesheets were read and from which hosts. No AI model is used: the same page gives the same theme.
Limits:
- A site that draws itself with scripts gives little. The proposal then says so and you set
bg,textandaccentby hand. - At most 8 stylesheets are read. When a page links more, the ones most likely to hold its colours are chosen: linked
in
<head>, with a name likemain,themeortokens, not a font's, an icon set's or a slider's. Print and alternate stylesheets are skipped. The report says how many were left out. - Colours computed in the browser (
calc()inside a colour,color-mix(),lab()) are not read. - The proposal is a starting point. Read the report, then edit the YAML.
What leaves Petawork: this is the one outbound call of themes. It is made only when you (or your agent) ask, to the
address you give and to the stylesheets that page links. A stylesheet may be on another host, because most companies
serve their CSS from a CDN; the hosts of public font and library CDNs (Google Fonts, Typekit, Font Awesome, cdnjs,
jsDelivr, unpkg) are never asked. Petawork sends no cookie and nothing about you or your organisation. Every address,
the page's and each stylesheet's, passes the same checks: only public addresses are fetched, so private, loopback,
link-local and cloud metadata addresses are refused, checked again on each redirect (at most 3) and when the
connection is made, and this Petawork Cloud's own address is refused. In production the address must be https on the
default port. The page is read up to 1.5 MB. A stylesheet is read up to 2 MB, at most 8 of them, 3 at a time and 6 MB
between them. Each request has 8 seconds and the whole clone 20. Fonts, images and scripts are never fetched.
For agents
The workspace MCP server has five tools for the member behind the credential. They are not in the default listing of
/workspace/mcp; find them with workspace_tool_search or call them by name. Each has a REST twin under /api/v1. No
OAuth scope is needed: the member's role decides, read on every call.
| Tool | REST | What |
|---|---|---|
workspace_theme_list |
GET /themes |
The saved themes and which one the member uses. id reads one with its YAML. Pages with cursor and limit. |
workspace_theme_save |
POST /themes |
Create a theme from yaml, or replace the one named id. A theme that is not valid is refused with what to fix. |
workspace_theme_delete |
DELETE /themes/{id} |
Delete a theme. |
workspace_theme_use |
PUT /themes/active |
Switch the member to a theme by id, or to "default" for the built-in look. |
workspace_theme_clone |
POST /themes/clone |
Propose a theme from url. Saved only when save is true. Answers the YAML, what it found, what it guessed and what it adjusted. |
A team or service key has no member: it lists the themes and changes nothing. A read-only key changes nothing either.
To give someone their company's look:
- Call
workspace_theme_clonewith the company'surl(and anameif they gave one). - Show them the proposal: the colours, and above all the guesses and adjustments.
- When they agree, call it again with
save: true. To change a colour first, edit the YAML and callworkspace_theme_saveinstead. - Call
workspace_theme_usewith the new theme'sid. Tell them an open tab shows it on its next page load.
{ "name": "workspace_theme_clone", "arguments": { "url": "https://example.com", "name": "Example", "save": true } }Limits
| Themes per organisation | 50 |
| A theme's YAML | 16,384 characters |
| Name, description | 60 and 200 characters |
| Clone: page, stylesheet | 1.5 MB, 512 KB each, 4 stylesheets |
| Clone: time | 8 seconds a request, 20 in all |
| Clone: sites a member may ask for | 20 a minute |
A theme's id comes from its name (Acme Corp is acme-corp; a second one is acme-corp-2). It stays the same when
the theme is renamed.