Themes
A theme decides how a shop looks to its buyers: its home page, its product and collection pages, its cart and its account pages. The merchant picks a theme, arranges its sections and sets its colours and fonts in the admin; the theme turns that and the shop’s catalogue into HTML.
A theme is a server
Section titled “A theme is a server”A Kaladan theme is not a folder of templates that Kaladan renders for you. It is a small HTTP server in a container image. The platform runs one container per theme version, puts it behind each shop’s domain, and forwards the buyer’s request to it with everything it needs to answer:
- Who is asking about what: a signed context naming the shop, the route, the merchant’s settings and a Storefront API key, verified by the theme.
- The data: the theme queries the Storefront API on the shop’s own domain, server-side, with that key.
- The answer: HTML, with caching headers the platform honours per shop and per settings version.
Because the contract is HTTP, a theme can be written in anything. Kaladan’s own themes use Next.js and React, and there is a Nuxt and Vue starter.
What the merchant controls
Section titled “What the merchant controls”Everything a merchant can change is declared in the theme’s manifest,
theme.yaml, and nowhere else:
- Templates: which pages the theme renders, and which sections the visual editor offers on each.
- Sections and blocks: the pieces a merchant adds, removes and reorders, each with its own settings.
- Settings: typed controls (text, colour, image, product picker, …) whose values arrive in the render context.
- Styles: named looks that preset settings and layouts, so a merchant can start from something finished.
A setting’s id is permanent: it is a key in every merchant’s saved settings.
Renaming it would silently discard their work, so a rename across major
versions is declared as a migration instead.
Languages, money and dates
Section titled “Languages, money and dates”- Every merchant-visible string is a map keyed by locale tag.
- The render context tells the theme the page’s
direction, so a theme never guesses it from the language. - Money arrives with the shop’s divisor and numeral system, and dates in UTC with the shop’s calendar. The theme formats both when it renders.