Theme packages (beta)
Beta: package structure, placeholders, catalog, workspace upload, and install modes.
Beta. Sites theme packages are in beta. Package ids, install modes, and response shapes may change before general availability.
Theme packages are installable looks and layouts for Sites websites on styrar.site. A package can include theme tokens, multi-page layouts, chrome blocks, and optional custom block/section HTML with a settings schema. Install always copies into a draft SiteVersion. The public site never live-links remote theme code.
Download the reference theme (beta): styrar-reference-theme.zip
Authoring guide (placeholders, zip layout, JS policy): Theme authoring.
Plan requirement: API access requires Team or Agency. See pricing.
Base URL: https://api.styrar.com/v1
How authoring works
| You author | Styrar does |
|---|---|
Theme token JSON (colorScheme, fonts, buttons, …) | Maps tokens to CSS variables on the published page |
Optional customCss | Injects sanitized CSS using those variables |
Multi-page pages / pageMeta + chrome blocks | Renders sections and blocks to HTML |
Optional blocks/*/definition.json + template.html | Settings-driven inspector fields; SSR fills {{ settings.* }} |
Optional local template.js | Runs on the page; external script URLs are sandboxed |
Default markup uses placeholders ({{ settings.title }}, {{{ settings.body }}}, {{#blocks}}, {{ include "snippet" }}). Optional HTML <template> is for client cloning only.
Package structure
{
"schemaVersion": 1,
"id": "styrar.studio",
"name": "Studio",
"description": "Light editorial look with About page and pull quote.",
"author": "Styrar",
"version": "1.0.0",
"category": "portfolio",
"swatch": { "background": "#f7f5f0", "accent": "#1a1a1a" },
"theme": {
"colorScheme": {
"background": "#f7f5f0",
"text": "#1a1a1a",
"accent": "#1a1a1a",
"buttonBg": "#1a1a1a",
"buttonText": "#f7f5f0"
},
"fontFamily": "'Playfair Display', Georgia, serif",
"containerWidth": "wide"
},
"pages": ["/", "/about"],
"pageMeta": {
"/": { "title": "Home", "sections": [] },
"/about": { "title": "About", "sections": [] }
},
"blocks": [],
"blockDefinitions": [],
"sectionDefinitions": [],
"snippets": {},
"components": []
}
| Field | Role |
|---|---|
theme | Look tokens (same shape as SiteVersion.theme) |
pages / pageMeta | Multi-page IA + section trees |
blocks | Chrome (site_nav, hero, footer, …) and package-defined kinds |
blockDefinitions / sectionDefinitions | Custom kinds with settings + HTML partials |
snippets | Named HTML for {{ include "name" }} |
swatch | Gallery preview colors |
Workspace uploads may use a theme zip (theme.json, templates/, sections/, blocks/, snippets/, assets/) via the Theme tab or POST /v1/sites/theme-packages/workspace.
Theme tokens → CSS variables
| Token field | CSS variable |
|---|---|
colorScheme.background | --bio-bg |
colorScheme.text | --bio-text |
colorScheme.accent | --bio-accent |
colorScheme.buttonBg | --bio-btn-bg |
colorScheme.buttonText | --bio-btn-text |
fontFamily / Google font | --bio-font |
buttonRadius | --bio-btn-radius |
containerWidth | --bio-page-width |
Catalog
| Id | Name | Category | Pages |
|---|---|---|---|
styrar.studio | Studio | portfolio | /, /about |
styrar.midnight | Midnight | commerce | /, /shop |
styrar.soft | Soft | portfolio | /, /work |
styrar.contrast | Contrast | agency | /, /services |
First-party packages ship in product (beta). For a zip you can open and edit locally, use the reference theme download (beta) (styrar.reference).
Authorization: Bearer sty_live_your_api_keyAuthorization: Bearer sty_live_your_api_keyCreate a site from a package
Pass a package id as templateId (structural starters: blank, portfolio, booking, store; or a workspace package id).
Authorization: Bearer sty_live_your_api_key
Content-Type: application/json
{
"companyId": "clxyz_company",
"title": "Studio site",
"templateId": "styrar.studio"
}Install onto a draft
Authorization: Bearer sty_live_your_api_key
Content-Type: application/json
{
"packageId": "styrar.midnight",
"mode": "theme"
}mode | Effect |
|---|---|
theme | Merge package colors, fonts, and buttons. Keeps existing pages. |
full | Replace theme, pages, sections, chrome, and theme definitions. |
Export a draft as a zip with POST /v1/sites/:id/versions/:versionId/export-theme-package.
Upload a workspace package
Authorization: Bearer sty_live_your_api_key
Content-Type: multipart/form-dataForm field file = theme zip (store-only). Or send JSON { "package": { … } }.
Authorization: Bearer sty_live_your_api_keyWorkspace theme presets
Token-only snapshots (not full packages):
| Method | Path | Scope |
|---|---|---|
| GET/POST | /v1/sites/theme-presets | links:read / links:write |
| DELETE | /v1/sites/theme-presets/:id | links:write |
Related
- Theme authoring - placeholders, zip layout, JS policy
- Sites overview - create sites and related routes (beta)
- Sites API - full Sites route table
- Authentication - scopes and API keys