Skip to Content
MinexonMinexon

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.webp

Start 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"
    }
  }
}
FieldAccepted value
idAn 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.
versionA three-part version such as 1.0.0. Prerelease suffixes such as 1.0.0-beta.1 and build metadata with + are supported.
previewOptional PNG, JPEG or WebP at the theme root or under assets/. The actual image format must match its extension.
stylesOptional 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.
settingsOptional 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.twig files under templates/. 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 with theme_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.json has a 256 KiB limit. Your hosting environment can impose a lower upload limit.

Install and check the appearance

  1. Place the apps directory at the root of the ZIP and upload it through Add theme. Add a theme
  2. Check the preview and version on the theme card. Open its settings icon to check its fields and defaults. Themes
  3. 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