Your own theme
Build a theme on top of standard: theme.json, your colours and font, a first template edit, a check in Studio and a ZIP archive to install from the admin panel.
At the end you will have the Nightfall theme: a dark palette with a violet accent, its own font and a line in the footer, packed into a ZIP archive that installs on any Flute site from the admin panel. It takes about half an hour.
You need a Flute site with access to its files, preferably a local one: php flute serve in development mode rebuilds styles and reloads the page on every edit. The preview needs the "Site theme" permission (sections.theme), installing a theme needs admin.boss.
The theme extends standard and keeps only what it changes. Do not copy the whole standard folder: such a copy stops receiving new core templates, and after a Flute update some pages break.
Folder and theme.json
The theme key is its folder name. Use lowercase Latin letters, digits and dashes: nightfall.
mkdir -p app/Themes/nightfall/assets/sass/theme app/Themes/nightfall/views/layouts app/Themes/nightfall/views/partials app/Themes/nightfall/lang app/Themes/nightfall/presets/skin{
"name": "Nightfall",
"version": "1.0.0",
"author": "Your Name",
"description": "Dark theme with a violet accent",
"extends": "standard",
"scheme": "dark"
}"scheme": "dark" says the theme paints only the dark scheme, so the light scheme switch disappears from the site. Only name is required. The other keys, Studio settings included, are described in Theme parameters.
Colours and font
The main stylesheet imports the whole standard bundle first, then your partials. Importing the parent by path keeps every future core style working for your theme. You will need _footer.scss in the next section.
@import 'Themes/standard/assets/sass/app';
@import 'theme/tokens';
@import 'theme/footer';Tokens go in :root[data-theme] without !important. That way the site owner can change any of them on the Studio Style tab.
:root[data-theme] {
color-scheme: dark;
--background: #0d0b14;
--foreground: #ece9f5;
--surface: #16131f;
--surface-secondary: #1d1929;
--muted: #9a93ad;
--border: #2a2438;
--accent: #8b5cf6;
--accent-foreground: #ffffff;
--font-body: 'Manrope', system-ui, sans-serif;
--font: var(--font-body);
}Repeat the same values in the theme palette. It is the original look the Style tab returns to with "Reset all to the theme". Without its own palette Studio takes the standard one and, after the first style publish, repaints the site in its grey and orange.
{
"key": "flute.neutral",
"version": "1.0.0",
"label": "theme.skin_label",
"meta": {
"group": "games"
},
"values": {
"background": "#0d0b14",
"foreground": "#ece9f5",
"surface": "#16131f",
"surface.secondary": "#1d1929",
"muted": "#9a93ad",
"border": "#2a2438",
"accent": "#8b5cf6",
"accent.foreground": "#ffffff",
"font.body": "'Manrope', system-ui, sans-serif"
}
}The theme names its font in theme.json. Manrope ships with the engine, so the name is enough: the engine links the font styles itself.
"fonts": [
{"family": "Manrope"}
]A font the site does not have travels with the theme as .woff2 files. Theme parameters shows how to describe them. The theme check refuses a link to a font on another site, Google Fonts included.
First template edit
A theme template replaces the standard template with the same path. To add a line to the footer without copying it, include the original and put your part after it:
@include('Themes.standard.views.layouts.footer')
<p class="nightfall-note">{{ __('theme.footer_note') }}</p>To change the footer itself, copy app/Themes/standard/views/layouts/footer.blade.php to this place and edit the copy. The line's text and the palette name come from the theme translations:
{
"footer_note": "The server is open every evening",
"skin_label": "Nightfall"
}{
"footer_note": "Сервер открыт каждый вечер",
"skin_label": "Nightfall"
}The line's style lives in _footer.scss, already imported in app.scss:
.nightfall-note {
margin: 0;
padding: 12px 0 24px;
text-align: center;
color: var(--muted);
}Check
Clear the cache so the site sees the new folder and builds the styles:
php flute cache:clearOpen the site with the preview parameter: https://<YOUR_DOMAIN>/?studio=1&studio_theme=nightfall. Studio shows the pages in the new theme to you only, visitors still see the active one. Go through the home page, sign-in, a profile and module pages: the dark background, violet buttons and the footer line should be everywhere.
Studio shows the old theme
The site does not see the folder yet: the theme list is cached for an hour. Run php flute cache:clear and make sure the folder name matches the address. If theme.json cannot be read, the reason is in the templates log. The preview does not work in worker mode, so run php flute serve without --worker.
When a theme is turned on from Studio, Flute first runs the full check: safety rules, compiling every template and stylesheet, rendering the home page, /privacy and a 404 page. Add your important addresses to check_paths in theme.json and they get rendered too. The "Install" and "Apply" buttons in the admin panel do not run this check. What the rules forbid is listed in How themes work.
Put a 16:10 preview.webp, about 1280×800, in the theme root: the theme card in the admin panel shows it while the theme is not active.
Archive
Wrap the theme in a folder named after its key: the site uses that folder name to decide where to put it. The archive from "Download theme" is built the same way.
cd app/Themes
zip -r nightfall.zip nightfall -x '*.DS_Store'The archive holds a single nightfall/ folder with theme.json inside. If you put the files at the archive root instead, add "key": "nightfall" to theme.json. An archive over 50 MB (or the PHP upload limit) or over 100 MB unpacked will not upload.
Install on a site
On another site open AdminExtensionsThemes, click "Upload ZIP" and choose nightfall.zip. The theme shows up under "Installed themes". Click "Install" on it: after you confirm, the theme goes live for visitors right away. To switch back, click "Apply" on the previous theme's card.
Theme Nightfall already exists. You can replace its files with this archive.
The site already has a theme with the nightfall key. To install the new version, click "Replace installed version". Raise version in theme.json so the card shows the versions apart.
Other upload messages are listed in Themes.