{% comment %} — a live theming devtool. Drop it once (e.g. before in your base layout) and it floats a compact launcher in a corner. Open it to tweak the kit's theme tokens and the whole page re-themes in place — the live site is the preview, so there's no built-in specimen. Copy the generated :root { } + .dark { } override block into your own CSS to make a theme permanent. Tokens are written to , so the page stays fully visible, scrollable and interactive while you adjust (no modal, no backdrop, no scroll-lock). Per-mode values (accent, surface lift) follow the site's own dark class and re-apply when an appearance toggle flips it. By default the working theme is saved to localStorage so it survives navigation and reloads (it's a preview aid, not a substitute for the exported CSS). Reset restores the kit defaults. position — bottom-right (default), bottom-left, top-right, top-left. :open — start expanded. :persist — save the working theme to localStorage (default True). storage_key — localStorage key; namespace it per app/env when scaling (default "cotton-ui:theme-builder", holding a versioned JSON blob). {% endcomment %}
{# ---- Launcher (collapsed): paintbrush FAB; a 'reset' link appears to its left while a theme override is active ---- #}
{% comment %}Palette priming: forces the build to emit a --color-*-* var for every accent and gray shade the controls remap to live (the kit otherwise only emits the zinc scale it uses). Tailwind scans this literal class list at build time; the element never renders.{% endcomment %} {# ---- Card (expanded) ---- #}
{# Header #}
Theme
{# Scrolling control body #}
{% comment %}Accent. Swatches are server-rendered (Django loop) so each can carry the kit's own xs tooltip with the colour name; Alpine still drives click + active ring.{% endcomment %}
Accent
{% for c in accent_list %} {{ c|capfirst }} {% endfor %}
{# Gray base — remaps the zinc scale the kit is built on. #}
Gray
{% for c in gray_list %} {{ c|capfirst }} {% endfor %}
{% comment %}Form controls / Structural via the kit's own Tabs (fill = equal-width nav). Multi-option tokens use compact right-aligned native selects: @change writes the value and re-themes; :selected reflects state (avoids the x-model + x-for-options init race that would otherwise pin the select to its first option).{% endcomment %}
Radius
Button radius
Shadow
Focus ring
Radius
Shadow
Card border
{# Surface lift is the one token set per-mode, so light and dark each get a slider. #}
Light mode surface (%)
Dark mode surface (%)
{# ---- CSS override: compact, collapsible, with copy ---- #}