Theme

A custom daisyUI theme edited in the admin, with no Tailwind rebuild.

How it works

DaisyUI v5 themes are plain CSS variables, so the saved theme is emitted as a <style> block. It writes one theme, named custom. Existing themes are untouched, and anything the theme leaves unset falls back to the site's default.

There is no custom fieldtype and no script. The theme is an ordinary object field on an ordinary page (pages/theme, view @theme), so it shows in the tree, follows page permissions and gets drafts and history. Edits autosave as a draft and the admin preview reloads in place, so you can browse the real site while you edit.

Piece Where
The fields, as an object with inline sub-fields fields/theme/_index.json
The <style> block for the site <head> views/theme.latte
A sample of components on the theme views/sample.latte

A sub-field named color_primary_content sets --color-primary-content, and radius_box sets --radius-box, so adding a variable is one line of JSON. Colors are core color fields and take any CSS color, including oklch(...).

Wiring

Mount the addon and create a page at that slug whose view is @theme:

{ "addons": { "phlat/theme": { "mount": "theme" } } }

Then include the partial in your layout <head>, after the stylesheet links. It emits nothing until the theme has values.

{include '@theme/theme.latte'}

The addon only defines the theme. Using it is the site's decision: data-theme="custom" on <html>, adding custom to the list a theme picker offers, or a scoped container. While you are logged in, drafts show on every page in the preview, so a theme in use previews across the site before you publish.