Theme parameters
Every theme.json key, frame settings for Studio and the Style tab tokens: how a theme declares them and how they reach the CSS.
This page lists every theme.json key the engine reads and shows how a theme hands settings to the owner in Studio: frame switches, palettes, fonts and tokens. The theme as a whole is covered in How themes work.
theme.json
Only name is required, the other keys are optional. The file has no schema: an unknown or misspelt key is silently ignored, so check names against the table.
{
"name": "Nightfall",
"version": "1.0.0",
"author": "Your Name",
"description": "Dark theme with a violet accent",
"extends": "standard",
"scheme": "dark",
"check_paths": ["/servers", "/shop"]
}| Key | What it does | Read by |
|---|---|---|
name | name in the theme list. Without it the archive will not install | SyncsThemesWithDatabase, ThemeArchiveInstaller |
version, author, description | version, author and description on the theme card | SyncsThemesWithDatabase |
key | folder name when installing from a ZIP. Without it the name of the folder wrapping the theme in the archive is used. Latin letters, digits, - and _, up to 64 characters | ThemeArchiveInstaller |
extends | parent theme. Template lookup and Studio frame settings also accept the parent alias, but presets, fonts and decor follow extends only | ThemeFallbackResolver, FrameSchema, Studio registries |
api_version | theme API version the theme targets. The core provides 1. A theme with a higher number is refused on archive upload; an installed one only logs a warning | ThemeManager, ThemeArchiveInstaller |
scheme | dark or light: the theme paints only this scheme. The scheme switcher hides and a colour edit on the Style tab writes both schemes. Inherited | ThemeManager::scheme() |
frame | frame settings for Studio, see below | Studio\Frame\FrameSchema |
zones | zones for blocks: {"zone.key": "label"}, see below | FrameSchema::registerZones() |
skeleton | frame template for "Site template" in Studio: a template file, parts with their views and zones, checks | Studio\Skeleton\SkeletonSpec |
layout | labels for frame parts: {"part": {"selector": "...", "about": "..."}}, up to 12. Studio shows them in "Site template" | Studio\Frame\LayoutMap |
fonts | theme fonts for the "From the theme" group, see below | Studio\Fonts\FontRegistry |
scoped_styles | SCSS sent only to the pages that need it: {"name": {"views": [...], "scss": [...]}} | AssetResolution, ScopedStyles |
asset_scss_append | extra SCSS files in the main bundle: {"main": ["Themes/nightfall/assets/sass/extra.scss"]} | AssetResolution |
check_paths | up to 12 of your own paths the theme check renders before activation. Site paths only, no host and no .. | Theme\Authoring\ThemeCheck |
replacements | swap a template by exact name: {"flute::pages.home": "flute::pages.home-wide"} | HandlesThemeCache |
module_replacements, wildcard_replacements | the same by regular expression and by fnmatch mask | HandlesThemeCache |
asset_replacements, asset_module_replacements, asset_wildcard_replacements | the same for asset paths | AssetResolution |
layout_arguments | variables shared into every theme template | Template::render() |
settings | the old theme settings format. Rows are written to the database when the theme is first seen; no Flute 2.0 screen shows them | ThemeManager::getThemeSettings() |
A replacements swap applies only to templates rendered directly. For @include and <x-…> components, put a file with the same path under the theme's views/.
You can put preview.webp (16:10, about 1280×800) next to theme.json. The admin panel shows it on the theme card while the theme is not active.
Frame settings
The frame key describes the switches the owner sees in Studio on the Style tab, "Header and menu" section. The core knows only value types; what a key means is up to the theme. A template reads the value with frame('key'): the published value, the draft inside Studio, or default.
"frame": {
"header.layout": {
"type": "choice",
"label": {"en": "Navigation", "ru": "Навигация"},
"options": [
{"value": "top", "icon": "tb.outline.layout-navbar", "label": {"en": "Top", "ru": "Сверху"}},
{"value": "side", "icon": "tb.outline.layout-sidebar", "label": {"en": "Side", "ru": "Сбоку"}}
],
"default": "top"
},
"header.sticky": {
"type": "toggle",
"label": {"en": "Sticky header", "ru": "Липкая шапка"},
"default": true
}
}<header class="flute_header" data-header-sticky="{{ frame('header.sticky') ? 'on' : 'off' }}">| Type | Value | Notes |
|---|---|---|
toggle | true or false | |
choice | one of options | an option is a string, a number or {value, label, icon}. When every option has an icon, Studio draws the choice as tiles |
media | image path assets/....png | png, jpg, gif, webp |
link | address up to 2048 characters | |
color-token | name of a colour token such as accent | without options every colour token is offered |
A key uses lowercase Latin letters, digits and dashes, with dots between parts: game.play. label is a string or a {"locale": "text"} object. when shows the setting only while other settings have the given values: "when": {"header.layout": "side"}. An entry with an unknown type or an invalid default is dropped, the rest keep working.
A child theme inherits its parent's frame and changes only the keys it declares again. Each theme keeps its own saved values, so frame settings do not carry over when the theme changes.
Zones
A zone is a place in the theme where the owner puts blocks. The theme declares zones under zones, and a template prints them with section_zone('key') or, for a header or footer with columns, section_zone_regions('key'). A zone's starting content lives in zones/<key>.json and is looked up along the inheritance chain.
"zones": {
"shell.header": {"en": "Header", "ru": "Шапка"},
"shell.footer": {"en": "Footer", "ru": "Подвал"},
"footer.blocks": {"en": "Footer blocks", "ru": "Блоки подвала"}
}@php
$_shell = section_zone_regions('shell.footer');
$_footerBlocks = section_zone('footer.blocks');
@endphpThe section_zone_regions() regions are start, center, end and controls. Keep #main, #modals, #alerts-container, #mobile-sidebar-toggle, #sidebar-nav and #sidebar-overlay in the frame outside the regions: core scripts rely on them.
Tokens and the Style tab
Colours, fonts, radii and the rest of the site's shape are CSS variables. The theme sets them in its SCSS, the owner changes them on the Studio Style tab, and the owner's values arrive in a separate file after the theme styles. For the owner's edits to work, the theme writes tokens in :root[data-theme] without !important and derives everything else from them with var(), color-mix() or oklch(from ...).
:root[data-theme] {
--background: #0d0b14;
--surface: #16131f;
--accent: #8b5cf6;
--accent-foreground: #ffffff;
--font-body: 'Manrope', system-ui, sans-serif;
--font: var(--font-body);
--card-hover: color-mix(in srgb, var(--accent) 8%, var(--surface));
}A token with !important or under html:root overrides the owner's edit: that colour can no longer be changed on the Style tab.
The SCSS values must match the theme's flute.neutral palette (below). Once the owner has published Style edits, Studio prints the whole palette over the theme styles. A theme without its own neutral.json gets its parent's palette, and those colours override the SCSS tokens.
| Token | Type | Values | CSS variable |
|---|---|---|---|
background, foreground, surface, surface.secondary, muted, border, separator | colour | per scheme | --background, --surface-secondary and so on |
accent, accent.foreground | colour | --accent, --accent-foreground | |
success, warning, danger and their .foreground | colour | --success, --danger-foreground… | |
background.type, background.gradient, background.image | page background | per scheme | body background |
font.body, font.display | font | family | --font-body, --font-display |
radius.scale | option | none, s, m, l, full | --radius, --radius-1 … --radius-6 |
density | option | compact, normal, airy | |
surface.style | option | flat, bordered, elevated, glass | |
shape | option | rounded, stepped, beveled | --shape-clip |
elevation | option | none, soft, strong | --shadow-small, --shadow-medium, --shadow-large… |
type.scale | option | compact, normal, large | |
motion, motion.speed | option | none, subtle, lively; slow, normal, fast |
The token list is defined in app/Core/Modules/Studio/Skin/SkinSchema.php, and the variable name comes from the key: -- plus the key with dots turned into dashes. Values go through ThemeCssValueSanitizer before they reach the CSS.
Palettes
The palettes under "Style" → "Ready-made themes" are the presets/skin/*.json files of the current theme and its parents, with the child's key winning. The palette keyed flute.neutral is the theme's original look: the Style tab counts edits from it, and "Reset all to the theme" returns to it. A theme with its own look declares its own presets/skin/neutral.json.
{
"key": "flute.neutral",
"version": "1.0.0",
"label": "theme.skin_label",
"meta": {
"description": "theme.skin_description",
"group": "games"
},
"values": {
"background": "#0d0b14",
"surface": "#16131f",
"accent": {"light": "#6d28d9", "dark": "#8b5cf6"},
"accent.foreground": "#ffffff",
"radius.scale": "m",
"font.body": "'Manrope', system-ui, sans-serif"
}
}key is lowercase Latin letters and digits joined by dots or dashes, version is three dot-separated numbers. label and meta.description are translation keys, and theme.* keys come from the theme's lang/*.json. meta.group sorts palettes into groups: product ("Calm"), games ("Games"), media ("Community and streams"). In values a colour is one string for both schemes or a {"light": ..., "dark": ...} object; unknown tokens are dropped.
Ready-made block looks sit next to them in presets/blocks/<block type>/<name>.json (standard has hero, feature-cards and cta-banner).
Fonts
The site always serves the font itself: the theme names it in theme.json and the engine links the styles in <head>. After that the SCSS and the font.body and font.display tokens need only the family name.
A family the site already has needs only its name. The engine ships Alegreya, Exo 2, Geist, Involve, Lora, Manrope, Montserrat, Noto Sans, Onest, Oswald, PT Serif, Roboto Condensed, Sofia Sans Condensed, Tiny5 and Unbounded. Fonts the owner uploaded in Studio count too.
"fonts": [
{"family": "Manrope"}
]Put your own font in the theme's assets/fonts/ and describe each face in its own entry. A family split into files by alphabet takes several entries with the same name:
"fonts": [
{
"family": "Nightfall Sans",
"weight": "400 800",
"style": "normal",
"unicode-range": "U+0000-00FF",
"files": ["nightfall-sans-latin.woff2"]
},
{
"family": "Nightfall Sans",
"weight": "400 800",
"style": "normal",
"unicode-range": "U+0400-04FF",
"files": ["nightfall-sans-cyrillic.woff2"]
}
]| Key | Meaning |
|---|---|
family | family name, required |
weight | a weight such as "400", or the range of a variable font, "400 800"; 400 when omitted |
style | normal or italic; normal when omitted |
unicode-range | which characters the file holds. An entry with a malformed range is skipped |
files | file names in the theme's assets/fonts/, .woff2 and .woff only. Several names in one entry are read as one face in different formats |
The engine copies the files to public/assets/fonts/themes/<theme key>/ and builds a fonts.css next to them. The copy refreshes itself when theme.json or a font file changes. Families with files appear in the Studio font picker under "From the theme". When none of an entry's files is in the theme, the font is listed but unavailable.
The theme check refuses links to fonts and stylesheets on other sites, Google Fonts included: download the files and put them in the theme.
A decor pack is frames, textures and corner shapes on top of a palette. A theme puts it in decor/<name>/decor.json with key, version, contract (currently 1), label, tokens and optionally fonts, icons, preview. Check a pack with php flute studio:check-pack <name>; the --install flag publishes its files. More on the command: CLI commands.
With "scheme": "dark" the page always opens in the dark scheme, <html> gets data-scheme-fixed, the scheme switchers hide and the Studio canvas stays dark. gamekit and every theme extending it work this way. In a template, theme_scheme() returns the theme's scheme.