Theme Development Guide

Build commercial-grade dizzy themes with a clear inheritance model, mode-aware assets, admin validation, and a release process suitable for marketplace distribution across current and future theme-enabled releases.

Package Aware Parent / Child Inheritance Prod / Dev Assets Admin Validation Commercial Theme Ready

Audience

Theme developers, agencies, and marketplace sellers who need to build or maintain a frontend dizzy theme without breaking the stock package.

What this guide covers

Theme discovery, manifests, inheritance, runtime asset loading, minified assets, token inheritance, admin activation, packaging, and QA expectations.

Recommended approach

Start from a child theme with parent: "default", keep overrides narrow, and always ship updated readable and minified runtime assets together.

This document covers the real Site Theme system. It is separate from the landing page selector under Manage Landing Page.
Table of Contents
Distribution Context
This guide is written for the dizzy theme system itself, not for a single release only. The examples below use the current stock distribution layout so developers can map the documentation to the package they received.
Fresh install In current stock distributions, fresh-install files are delivered in ScriptFiles/ and the installation database is delivered separately in MySQL/.
Update path Upgrade packages are delivered separately under Updates/. The exact update guide and SQL path can change from release to release, so always follow the update documentation bundled with that package.
Theme location Inside the package, stock themes live under ScriptFiles/themes/. After upload, that same structure becomes the runtime themes/ directory.
The stock package can include the base theme default and one or more example child themes such as testTheme. Separately licensed commercial themes may not be bundled into ScriptFiles/themes.
For clarity, this guide uses customTheme as a neutral example name for a theme you create yourself. It is an example only, not a bundled theme.
Quick Start
If you want the shortest safe path from zero to a shippable child theme, use this sequence:
  1. Create a new folder inside ScriptFiles/themes/, for example ScriptFiles/themes/customTheme.
  2. Add a theme.json manifest with a valid slug, a human-readable name, and parent: "default".
  3. Add a preview asset such as preview.svg or preview.png.
  4. Copy only the templates you intend to override, for example layouts/header/header.php or layouts/main.php.
  5. Maintain your visual system in scss/style.css and scss/night_style.css.
  6. Generate the production outputs style.min.css, night_style.min.css, and any required *.min.js assets before release.
  7. Upload or deploy the theme into the runtime themes/ directory, then open Admin > Design > Site Theme and activate it.
  8. Run a full smoke test across guest pages, authenticated pages, light mode, dark mode, AJAX partials, and mobile breakpoints before shipping.
The best default strategy is a child theme, not a full copy of default. In dizzy, missing files can resolve from the parent chain, so you should only own the files that are truly part of your product.
Runtime uses the CSS files in the scss/ folder. If you update style.css or night_style.css but do not regenerate the matching minified files, production can continue using stale assets.
Minified files are not optional in a professional release. In production mode, dizzy prefers style.min.css, night_style.min.css, and matching *.min.js files whenever they exist. If those files are outdated, the live site can ignore your latest CSS and JS changes.
Theme Architecture
The site theme system is built around a deterministic theme chain. dizzy resolves the active theme first, then walks up the chain until it reaches the base theme.
active theme -> parent theme -> default

Base Theme

The base theme is default. If a requested slug cannot be resolved, dizzy falls back to this base slug.

Parent Chain

A theme can declare a single parent in theme.json. Missing views, previews, and theme assets are resolved through that chain.

Loop Protection

The chain builder tracks visited themes and stops on cycles. You cannot safely build circular inheritance and the validator rejects self-parenting.

Discovery All readable directories inside themes/ are candidates. A valid theme does not need every file locally, but the resolved chain must satisfy the required view set.
Manifest theme.json is optional but strongly recommended. Without it, the system can infer defaults, but the result is not suitable for a polished commercial release.
View Resolution Templates and partials should be included through dizzy_theme_view_path() so the runtime can resolve the active theme chain instead of assuming a hardcoded directory.
Asset Resolution Theme assets can be resolved through dizzy_theme_asset_url() or through dizzy_asset_url('themes/<slug>/...'). Both paths eventually pass through the mode-aware theme resolver.
Recommended Folder Structure
A professional theme package should be clear about what is runtime-critical, what is optional, and what can be overridden. The structure below is a representative example, not a complete or restrictive file list.
Do not read this section as “only these files exist” or “only these files may be customized.” A dizzy theme can contain many more templates, partials, page files, assets, and landing plugin files. The purpose of this structure is to show the main areas developers typically work in.
ScriptFiles/
  themes/
    default/
      theme.json
      404.php
      age_verification.php
      becomeCreator.php
      blog.php
      blog_post.php
      chat.php
      contents.php
      hashtag.php
      invoice.php
      landing.php
      landing_two.php
      legal.php
      license.php
      live.php
      maintenance.php
      page.php
      payment-failed.php
      payment-success.php
      post.php
      posts.php
      product.php
      profile.php
      purchase_point.php
      reel_views.php
      register.php
      reset_password.php
      saved.php
      settings.php
      verifyme.php
      layouts/
        main.php
        agencies.php
        agency.php
        community.php
        communities.php
        community_leaderboard.php
        creators.php
        friends_stories.php
        header/
          age_confirm.php
          meta.php
          css.php
          javascripts.php
          header.php
        left_menu.php
        login_form.php
        page_right.php
        posts.php
        storyImageCreator.php
        storyTextCreator.php
        live/
          freeLive.php
          paidLive.php
          scheduledLive.php
      scss/
        style.css
        style.min.css
        night_style.css
        night_style.min.css
      js/
        age-confirm.js
        age-confirm.min.js
        agencyDirectory.js
        agencyDirectory.min.js
        character_count.js
        character_count.min.js
        creatorAgencies.js
        creatorAgencies.min.js
        creatorAutoMessage.js
        creatorAutoMessage.min.js
        creatorBulkMessages.js
        creatorBulkMessages.min.js
        inora.js
        inora.min.js
        inora_do.js
        inora_do.min.js
        main.js
        main.min.js
        community.js
        community.min.js
        obsOverlays.js
        obsOverlays.min.js
        share.js
        share.min.js
        videojs-loader.js
        videojs-loader.min.js
      css/
      img/
      mp3/
      landing_plugins/
    testTheme/
      theme.json
      preview.svg
    customTheme/
      theme.json
      preview.svg
      blog.php
      profile.php
      layouts/
        community.php
        header/
          header.php
      scss/
        style.css
        style.min.css
        night_style.css
        night_style.min.css
      js/
        main.js
        main.min.js
        community.js
        community.min.js
      img/
        hero-pattern.png
      landing_plugins/
        customLandingPlugin/
          manifest.json
          preview.png
          landing.php
How to read this structure
  • Top-level page files such as blog.php, profile.php, chat.php, and settings.php are valid theme override points.
  • The layouts/ directory is where most reusable partials, wrappers, widgets, and page sections live.
  • The scss/ and js/ directories are runtime-critical because prod mode can load their minified pairs.
  • The css/, img/, and mp3/ directories contain supportive theme assets that can also be overridden or extended.
  • The landing_plugins/ directory is separate from the core site theme and should be used only for landing page plugins.

Minimal child theme

The absolute minimum is usually theme.json, a preview image, and the handful of overridden files you actually need.

Bundled example

The stock package includes ScriptFiles/themes/testTheme as a lightweight example of a child theme with a manifest, preview, and token-based styling.

Commercial expectation

A sellable theme should ship maintainable CSS, minified production assets, a stable preview, and clear version metadata.

theme.json Manifest
The manifest is the contract between your theme and the dizzy runtime. Keep it short, valid, and accurate.
{
  "name": "Custom Theme",
  "version": "1.0.0",
  "description": "Production-ready child theme for dizzy.",
  "author": "Your Company",
  "parent": "default",
  "preview": "preview.svg",
  "tokens": {
    "brand_primary": "#eab308",
    "brand_secondary": "#f59e0b"
  },
  "light_tokens": {
    "page_background": "#fffdf2",
    "panel_background": "#ffffff",
    "menu_text": "#5b3b00"
  },
  "dark_tokens": {
    "page_background": "#17120a",
    "panel_background": "#241c11",
    "menu_text": "#fff4c2"
  }
}
name Human-readable theme name shown in the admin theme list.
version Theme release number. Use semantic versioning if you plan to ship updates.
description Short summary for administrators and buyers.
author Company or developer identity displayed in admin.
parent Parent theme slug. For most third-party themes this should be default.
preview Relative path to the preview file inside the theme directory. If omitted, the system falls back to the base preview image.
tokens Shared token values applied in both light and dark modes.
light_tokens Light-mode-only token overrides.
dark_tokens Dark-mode-only token overrides.
Theme slugs and folder names must use only A-Z, a-z, 0-9, underscore, and hyphen. Do not use spaces, dots, or special characters.
Resolver Rules
Understanding the resolver is the difference between a theme that survives updates and a theme that breaks the first time the base theme changes.
1. View resolution
<?php include dizzy_theme_view_path('layouts/footer.php'); ?>
<?php include dizzy_theme_view_path('layouts/header/header.php'); ?>
2. Theme asset resolution
<link rel="stylesheet"
      href="<?php echo iN_HelpSecure(dizzy_theme_asset_url('scss/home-extra.css', (string)$version)); ?>">

<script src="<?php echo iN_HelpSecure(dizzy_theme_asset_url('js/main.js', (string)$version)); ?>" defer></script>
3. When direct theme paths are still acceptable
<?php
$themeName = isset($currentTheme) ? (string)$currentTheme : 'default';
?>
<script src="<?php echo iN_HelpSecure(dizzy_asset_url('themes/' . $themeName . '/js/community.js', (string)$version)); ?>" defer></script>
dizzy also intercepts themes/<theme>/... asset paths and routes them through the same mode-aware theme resolver. This means the current core templates can safely use either dizzy_theme_asset_url() or dizzy_asset_url('themes/' . $themeName . '/...'). For new theme code, the dedicated helper remains the clearest option.
Resolver guarantees
  • Missing views are searched in the parent chain before the runtime gives up.
  • Theme preview assets are resolved through the same chain.
  • Theme CSS and JS files are also mode-aware, so prod can prefer .min assets while dev prefers readable files.
  • If a requested asset does not exist in the child theme, the chain can resolve the file from the parent or default.
What not to do
// Avoid hardcoding the base theme
include 'themes/default/layouts/footer.php';
echo '<script src="themes/default/js/main.js"></script>';

// Prefer the resolver
include dizzy_theme_view_path('layouts/footer.php');
echo '<script src="' . iN_HelpSecure(dizzy_theme_asset_url('js/main.js', (string)$version)) . '"></script>';
Assets and Build Pipeline
For theme developers, the most important runtime rule is simple: the browser consumes the CSS and JavaScript files inside the active theme, and production prefers the minified variants when they exist.
Why minified files matter
  • Production mode prefers minified CSS and JS files automatically.
  • If a minified file exists, it can override the readable file during live runtime.
  • Updating only style.css or main.js is not enough for a release build.
  • Outdated minified files are one of the easiest ways to ship a broken or partially updated theme.
Light CSS scss/style.css in dev, scss/style.min.css in prod when available.
Dark CSS scss/night_style.css in dev, scss/night_style.min.css in prod when available.
JavaScript *.js in dev, *.min.js in prod when available.
Dev cache busting When the asset mode is dev, dizzy can append a file modification time query string automatically.
The active installation can force asset mode through DIZZY_ASSET_MODE, environment values, or related runtime globals. In practical terms: ship the plain files for maintainability, and ship the minified files for production correctness.
Recommended release map
scss/style.css        -> scss/style.min.css
scss/night_style.css  -> scss/night_style.min.css
js/main.js            -> js/main.min.js
js/community.js       -> js/community.min.js
Example release commands
terser themes/customTheme/js/main.js -o themes/customTheme/js/main.min.js --compress --mangle
terser themes/customTheme/js/community.js -o themes/customTheme/js/community.min.js --compress --mangle
If your production installation runs in prod mode, stale .min files will win over fresh readable files. A professional release must keep style.css, night_style.css, and their matching minified outputs synchronized.
Release rule: every time you change a runtime CSS or JS file that has a minified pair, regenerate the minified pair before delivery. This applies to theme CSS, page-specific CSS, and JavaScript files such as main.js, community.js, and other shipped frontend scripts.
Tokens and Light/Dark Modes
Tokens allow a child theme to reshape the visual system without rewriting every template. They are especially useful for brand color systems and mode-specific UI contrast.

Merge order

Token resolution starts from the base theme, then applies parent tokens, then applies the active child theme tokens. Child keys override parent keys with the same name.

Common vs mode-specific

tokens apply to both modes. light_tokens and dark_tokens override them only in the matching mode.

Admin overrides

Admin custom color settings can still override portions of the UI. Tokens should be treated as theme defaults, not as the final authority in every installation.

Useful token keys
brand_primary
brand_secondary
page_background
panel_background
panel_border
text_primary
text_muted
header_top
header_icon
menu_icon
menu_text
hover_surface
Practical example

The bundled ScriptFiles/themes/testTheme/theme.json shows a clean token setup: shared brand colors in tokens, then readable light/dark surface and text values in the mode-specific sections.

Tokens are best for color, surface, and text decisions. Do not try to force every layout difference into tokens. Structural changes still belong in theme templates and CSS.
Overriding Views and Assets
A child theme override works by matching the relative path of the file you want to replace.
themes/default/layouts/header/header.php
themes/customTheme/layouts/header/header.php
Good override targets
  • layouts/header/header.php for header markup and announcement areas.
  • layouts/main.php for page composition and wrapper changes.
  • post.php, profile.php, or page-specific templates for feature-specific UI changes.
  • scss/style.css and scss/night_style.css for the primary visual language.
Files to override carefully
  • layouts/header/css.php because it contains token injection, custom color handling, and the base stylesheet contract.
  • layouts/header/javascripts.php because it wires core scripts, PWA logic, and page-specific runtime features.
  • AJAX partials and widget layouts because they can be used in multiple screens and modal flows.
Override as narrowly as possible. If you copy a large core file just to change one class or one icon, you increase your maintenance cost for every future update.
Activation and Admin Discovery
The admin theme screen is not just a selector. It is the operational gate that discovers, validates, previews, and activates themes safely.
What the admin page shows
  • Theme name, slug, author, version, description, and preview image.
  • Parent theme and the resolved chain.
  • Warnings such as missing preview assets or missing manifests.
  • Errors that block activation, such as missing required views or invalid parent references.
Activation flow
  1. An administrator clicks Activate on the Site Theme page.
  2. The request is protected with CSRF validation.
  3. dizzy validates the selected theme again on the server side.
  4. If validation passes, the system writes the theme slug into i_configurations.active_theme.
  5. The write is verified immediately. If verification fails, the previous theme is restored.
This rollback behavior is important for commercial themes. It reduces the risk of leaving a customer on a broken configuration after a failed activation attempt.
Landing Plugins vs Site Themes

Site Theme

Controls the real product UI: layouts, page templates, core theme assets, tokens, guest pages, member pages, and the active frontend experience.

Landing Plugin

Controls a landing experience under the landing page system. It is not a replacement for a full site theme and should not be treated as one.

Landing plugin location
themes/customTheme/landing_plugins/customLandingPlugin/
  manifest.json
  preview.png
  landing.php
Use a landing plugin when you only want to customize the public marketing or guest entry flow. Use a site theme when you want to own the member-facing application UI.
Packaging a Commercial Theme
If you plan to sell a theme, package it like a product, not like a local experiment.
Ship these files
  • theme.json with a real version number and accurate metadata.
  • A clean preview asset that represents the shipped design.
  • All overridden PHP templates you own.
  • Editable CSS files and readable JavaScript files.
  • Production-ready minified CSS and JS files.
  • Any custom images, fonts, icons, audio files, or landing plugin assets required by the theme.
If your package includes style.min.css, night_style.min.css, or any *.min.js file, those files must reflect the latest readable files in the same theme. Shipping mismatched minified assets is a release defect.
If you are selling a standalone theme, package only your theme directory and its required assets. Do not redistribute unrelated bundled themes or the full stock ScriptFiles tree unless your distribution terms require it.
Do not ship these mistakes
  • Stale .min files that no longer match the readable source files.
  • Broken parent references.
  • Preview files that do not exist.
  • Temporary development assets, backups, or editor junk.
  • Hardcoded references to another custom theme.
Recommended release checklist
1. Bump the manifest version.
2. Review and finalize style.css and night_style.css.
3. Regenerate all minified CSS and JS outputs.
4. Confirm each .min file matches its readable pair.
5. Review the preview image.
6. Validate the theme in admin.
7. Smoke test in dev mode and prod mode.
8. Test activation on a clean installation.
9. Archive only the final theme folder for delivery.
Validation Rules
Before activation, dizzy validates slug format, manifest state, parent integrity, preview assets, and the resolved set of required views.
Required view set
404.php
layouts/main.php
layouts/header/meta.php
layouts/header/css.php
layouts/header/javascripts.php
layouts/header/header.php
landing.php
landing_two.php
settings.php
post.php
profile.php
chat.php
live.php
contents.php
These files do not all need to exist directly inside your child theme. They only need to exist somewhere in the resolved theme chain, normally through your parent theme or default.
Validation cannot protect against syntax errors or bad logic inside an overridden PHP file. It proves that the required files resolve, not that your code is bug-free. Always lint and test custom PHP before release.
Testing Checklist
A theme is not finished when the homepage looks correct. It is finished when the edge pages and modal flows still work under the active theme chain.
  • Guest landing pages and guest navigation.
  • Home feed, composer, stories, and comments.
  • Single post, profile, chat, settings, live, community, and blog pages.
  • AJAX partials, popups, notifications, widgets, and modal flows.
  • Light mode and dark mode contrast.
  • Mobile, tablet, and desktop breakpoints.
  • Theme activation and re-activation from admin.
  • Prod asset mode with minified files present.
Practical QA routine
1. Activate the theme in admin.
2. Hard-refresh the browser.
3. Visit guest pages while logged out.
4. Visit member pages while logged in.
5. Trigger modals, comments, and AJAX widgets.
6. Switch light/dark mode.
7. Confirm the site still works after cache clear.
8. Repeat once in a production-like asset mode.
Troubleshooting
Theme does not appear in admin
  • Check the folder name for unsupported characters.
  • Confirm the folder is directly inside themes/.
  • Check that the directory is readable and the manifest is valid JSON.
Theme appears but activation fails
  • Read the validation report on the Site Theme page.
  • Check the parent theme slug and the resolved required views.
  • Make sure the target installation contains the theme files you packaged.
The site still shows old CSS or JS
  • Regenerate the minified CSS and JS outputs after your latest CSS and JS changes.
  • Hard refresh the browser and clear CDN or proxy caches.
  • Remember that prod mode prefers .min files when they exist.
  • Check whether the readable file was updated but its minified pair was forgotten.
Colors look wrong in one mode
  • Define explicit light_tokens and dark_tokens instead of relying only on shared tokens.
  • Check whether admin custom color settings are overriding your defaults.
  • Verify that the active mode is loading the correct CSS output file.
FAQ
Where do I create my theme in the stock package?
Create it inside ScriptFiles/themes/. After deployment, that structure becomes the runtime themes/ directory.
Do I need to copy the entire default theme to create a new product theme?
No. A child theme can stay small. Copy only the templates and assets you actually want to own, and let the parent chain provide the rest.
Can a theme work without theme.json?
Technically yes, because the runtime can infer defaults. Professionally, no. A sellable theme should always ship a valid manifest.
Should I edit style.css directly?
Yes. In this workflow, style.css and night_style.css are the files you maintain. After updating them, regenerate the matching .min.css files for production.
Do I really need *.min files?
Yes, if the target installation runs in production mode and you want predictable runtime behavior. dizzy prefers minified CSS and JS in prod when those files exist, so a professional theme release should treat minified files as mandatory production assets.
Why does this guide not use a premium theme name in examples?
Stock packages may not bundle separately licensed commercial themes. This guide uses generic names such as customTheme so the documentation remains accurate across different distributions and future updates.
Best Practices
  • Start from a child theme and keep the diff against default as small as practical.
  • Prefer resolver helpers over hardcoded file paths.
  • Keep style.css, night_style.css, and the matching minified outputs synchronized on every release.
  • Use tokens for branding and contrast, and use template overrides for structure.
  • Test both guest and authenticated flows.
  • Test light mode and dark mode explicitly.
  • Ship a real preview image and a real version number.
  • Treat the admin validation screen as part of your release workflow, not as an afterthought.
If a project requires deep product restructuring rather than theme-level customization, treat that as bespoke development work. A theme package should improve presentation and frontend behavior without turning maintenance into a fork of the full application.

Back to the main documentation

Return to the installation, integrations, update notes, and general setup guide.

Build themes against the documented resolver, validation, and asset rules, not against assumptions. That is what keeps a commercial theme maintainable across future dizzy updates.