Build a theme package
Prepare a theme folder, manifest and custom settings as a ZIP.
Directory layout from the ZIP root
apps/main/themes/example/
theme-config.json
assets/
theme.css
preview.webpStart the archive at apps and include a single theme. In this example, theme-config.json is required and the CSS and preview are optional. Use / in paths and match the capitalization of file names. Password-protected entries, symbolic links, absolute paths, parent-directory traversal and case-only path duplicates are rejected.
Example theme-config.json
{
"id": "example",
"version": "1.0.0",
"preview": "assets/preview.webp",
"styles": ["assets/theme.css"],
"settings": {
"accent": {
"type": "color",
"label": "Accent color",
"default": "#2448b8"
}
}
}| Field | Accepted value |
|---|---|
id | An ID of up to 64 characters that exactly matches the directory name. Use lowercase ASCII letters and digits, with a single hyphen between segments if needed. flat is reserved for the built-in theme. |
version | A three-part version such as 1.0.0. Prerelease suffixes such as 1.0.0-beta.1 and build metadata with + are supported. |
preview | Optional PNG, JPEG or WebP at the theme root or under assets/. The actual image format must match its extension. |
styles | Optional paths, relative to the manifest, to existing .css files under assets/. List each path once. The Default layout loads the styles in the order listed. |
settings | Optional JSON object with up to 50 fields. A field key starts with a lowercase ASCII letter and can contain lowercase letters, digits, _ and -. |
Provide a type and label for each setting. The description, required and default fields are optional. Supported types are text, textarea, color, number, checkbox and select. Use a six-digit HEX value such as #2448b8 for colors. For select, provide an options object whose keys are stored values and whose values are labels. A non-empty default must match an option key. Defaults for required fields must satisfy the field’s validation rules.
In the example, accent adds a color field to the dashboard. To apply the color to an element, read player_theme().settings.accent in a template. For a CSS-only starting point, add a rule such as #main-content { border-top: 3px solid #2448b8; } to theme.css.
Add templates and assets
- Twig · Use
.html.twigfiles undertemplates/. To override a player template, keep the same relative path as in Default. Missing templates come from Default. Use the@flat/prefix to reference a Default template explicitly. Twig tags and filters are restricted. Use literal template paths and the built-in scripts for page behavior. - Assets · Put CSS, common image formats, fonts and audio under
assets/. Reference a packaged asset in Twig withtheme_asset('assets/file.webp'). SVGs are accepted when they match the original Default copy at the same relative path. PNG and WebP are available for custom images. PHP and JavaScript files are unsupported in upload packages. - Size · The limits are 25 MiB for the ZIP, 16 MiB per file, 64 MiB extracted and 1,500 archive entries.
theme-config.jsonhas a 256 KiB limit. Your hosting environment can impose a lower upload limit.
Install and check the appearance
- Place the
appsdirectory at the root of the ZIP and upload it through Add theme. Add a theme - Check the preview and version on the theme card. Open its settings icon to check its fields and defaults. Themes
- Activate it on a test installation. Check sign-in, navigation, the cart and footer in light and dark modes and on a narrow screen. Theme settings