community.dhcf.eu Sign in

theme.json

Theme manifest - metadata, layout compatibility, design tokens, file list.

theme.json

Every theme ships a theme.json at its root declaring metadata, the layouts it's compatible with, design tokens, and the list of files shipped. The manager UI validates this manifest on upload; the processor reads config to generate theme_css.

Location

For local themes:

public_html/lazysite/layouts/LAYOUT/themes/THEME/theme.json

For remote layouts (which bundle a theme in the same URL directory):

https://example.com/layouts/clean/theme.json

Format

{
  "name": "odcc",
  "version": "1.0.0",
  "description": "OpenDigitalCC brand theme",
  "author": "OpenDigitalCC",
  "layouts": ["default"],
  "config": {
    "colours": {
      "primary": "#332b82",
      "text": "#2a2a2a",
      "accent": "#ff6b35"
    },
    "fonts": {
      "body": "Open Sans",
      "heading": "Source Sans 3"
    },
    "spacing": {
      "unit": "8px"
    }
  },
  "files": [
    "theme.json",
    "main.css",
    "assets/logo.svg"
  ]
}

Required fields

Optional fields

Auto-generated CSS variables

The processor walks config and emits a <style>:root { ... } block exposed as [% theme_css %]. Naming convention:

--theme-GROUP-KEY

So config.colours.primary = "#332b82" becomes --theme-colours-primary: #332b82. Values are emitted verbatim except ;{}<> characters which are stripped to prevent declaration escape.

theme_assets variable

[% theme_assets %] is set to:

Validation summary

Condition Result
name missing or unsanitisable Install rejected
layouts missing or empty Install rejected
Declared layout not installed Install rejected
Active layout not in layouts[] Theme ignored at render
config not an object theme_css empty
Nested group value (not a scalar) Value skipped silently

Notes