High-level concepts
- Template: a full page composition made of one or more layouts and components. Each Sitecopilot theme defines templates for common page types (home, content, listing).
- Layout: the outer page skeleton (header, footer, main regions). Layouts include slots where components render.
- Component: reusable UI piece (hero, card, navigation, footer). Components accept props that map to tokenized styles and content data.
- Token Context: a runtime object containing the theme tokens (colors, spacing, typography). The template engine exposes tokens as CSS variables and Tailwind classes derived from
tailwind.config.js.
How tokens are applied
- During the theme build,
tailwind.config.jsis generated from the tokens JSON. The build produces a Tailwind CSS file and a set of CSS variables. - At runtime, Sitecopilot injects the token CSS variables into the page
<head>(or as a style block) for immediate theming without a full rebuild when switching themes/server-side rendering. - Components reference tokens via CSS variables and via Tailwind utility classes (derived from the generated config).
Adding a custom theme (summary)
- Export tokens from Figma and generate
tailwind.config.js(see Figma Design Tokens page). - Export HTML + Tailwind code from Figma (FireJet) and extract component markup & assets.
- Place the theme under
/themes/<theme-name>/with:tailwind.config.jssrc/(component HTML/JSX/CSS fragments)assets/(images, fonts)mapping.json(optional token mapping)
- Build the theme using the provided build script (example using Node):
- Register the theme in Sitecopilot (Admin → Themes) or add it to the tenant’s theme list via API.
- Apply the theme to a tenant (Admin UI or API) and validate pages.
Development tips
- Pin Tailwind and plugin versions in
package.jsonto avoid theme regeneration issues between builds. - Keep generated CSS minimal: enable PurgeCSS/JIT and configure content paths precisely.
- Prefer small, reusable components over large monolithic HTML exported from Figma — it simplifies maintenance and swaps.