In short
A Theme is the Site's look stated once: palette, style, ground and fonts. It is stored as a record in
site.theme, drafted and published like a Page, and read on every request. This page is for Site authors who
choose a look and Module authors who ship one.
How it fits
The Core API returns the Theme as part of the Site config from GET /api/v1/site. @phis/ui resolves it
once in the root layout into a single ordinary record, which every consumer then reads, and turns it into Ant
Design tokens. A Module can offer palettes, styles, grounds, fonts and Sets through its catalogue entry. The
Theme workspace in the Builder is where somebody chooses among them.
What matters
Four parts and a Set. A Theme is composed of a Palette, a Style, a Ground and Fonts. A Set names one
block of each part by key and may carry a logo; it composes and does not contain.
Offered, never imposed. Installing a Module that ships Theme blocks changes nothing a visitor sees. Its
blocks join the list in the Theme workspace, and somebody has to choose.
The author's values win. A stored record holds only the blocks the Site follows and the values its author
changed. Everything else is resolved from the blocks on every read.
Core is the floor. Core ships one block of each kind and one Set, all keyed phis. A part that names
nothing, or a block that is gone, runs on the core block, and the selection is not rewritten.
Saving adopts. Saving a Theme that resolves to a Module's blocks copies them into the Site's own
fields, pictures included. Core blocks are followed, never copied.
Example
A Site that follows the core Set and nothing else stores this in site.theme:
{
"blocks": {
"set": { "key": "phis" }
}
}
Each part is { key, version? }. An explicit part wins over the Set's part.