diff --git a/integrations/openwebui-theme-designer/INSTALLATION.md b/integrations/openwebui-theme-designer/INSTALLATION.md
new file mode 100644
index 0000000..6089435
--- /dev/null
+++ b/integrations/openwebui-theme-designer/INSTALLATION.md
@@ -0,0 +1,31 @@
+# Theme Designer Pro
+
+Installed on 2026-10-07 in the existing Unraid OpenWebUI container, version 0.11.4.
+
+- Upstream: https://github.com/silentoplayz/theme-designer-pro-presets
+- Original Event Function version: 1.8.5; revision and SHA-256 checksums in `manifest.json`.
+- Function ID: `theme_designer_pro`; type `event`; enabled centrally.
+- Designer: http://192.168.1.2:8095/api/v1/theme-designer (administrator login required).
+- `draft_mode_default=true`: preview changes before applying them.
+- `enable_canvas_api_access=false`: no authentication-token access for canvas effects.
+- Existing appearance retained; no preset applied during installation.
+
+No extra container, frontend rebuild, or custom frontend patch. The upstream function composes theme CSS and its loader through runtime routes. The frontend index hash remained unchanged during installation.
+
+## Persistence and restore
+
+Function source and valves are stored in `/app/backend/data/webui.db`. Theme files live under `/app/backend/data/theme/`. Both are in the existing persistent Unraid appdata volume `/mnt/user/appdata/open-webui`; include this directory in the OpenWebUI backup. This is an optional OpenWebUI integration, not a dependency of the native Athena Deck installation.
+
+Pre-install database backup: `/mnt/user/appdata/open-webui/plugin-backups/theme-20261007T142341Z/webui.db`. The backup also records the frontend index hash and copies an existing theme directory if present. Keep this database private: it contains application data and credentials.
+
+For a fresh OpenWebUI installation >=0.11.0, import the pinned `theme_designer_pro_event.py` as a Function, set the two valves above, then enable it. Alternatively run `install.py` inside OpenWebUI with this directory available and `PYTHONPATH=/app/backend`. It creates a database backup first and refuses to overwrite an existing function with this ID. No secrets are stored in this repository.
+
+Disable the Event Function in Administrator → Functions to turn off its theme integration. No Athena Deck restart is required.
+
+## Validation
+
+- Installed via normal authenticated Functions API; returned type `event`, active true.
+- Authenticated designer request: HTTP 200, HTML response.
+- Unauthenticated designer request: HTTP 401.
+- Frontend `/app/build/index.html` SHA-256 unchanged.
+- Browser rendering and applying a chosen theme remain user checks; no theme was selected automatically.
diff --git a/integrations/openwebui-theme-designer/LICENSE b/integrations/openwebui-theme-designer/LICENSE
new file mode 100644
index 0000000..79bee9c
--- /dev/null
+++ b/integrations/openwebui-theme-designer/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2026 silentoplayz
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/integrations/openwebui-theme-designer/README.md b/integrations/openwebui-theme-designer/README.md
new file mode 100644
index 0000000..d91519a
--- /dev/null
+++ b/integrations/openwebui-theme-designer/README.md
@@ -0,0 +1,889 @@
+# ⚡ Theme Designer Pro (Event Function)
+
+> Instance-wide theme designer for Open WebUI — standalone admin page with server-side persistence, SSE live push, draft mode, and real-time theme enforcement across all users.
+
+
+
+
+
+
+---
+
+> [!IMPORTANT]
+> **Event Function vs. Tool — Which should you use?**
+>
+> Theme Designer Pro is available in two forms that target different audiences:
+>
+> | | **Event Function** (this file) | **Tool** |
+> |---|---|---|
+> | **Target audience** | Server administrators | Individual users |
+> | **Storage** | Server-side file persistence (instance-wide) | Browser `localStorage` (per-user, per-browser) |
+> | **Theme scope** | Global — applies to all users on the instance | Personal — only affects your own browser |
+> | **Requires admin** | Yes | No |
+> | **SSE live push** | Yes — all connected clients update in real-time | No |
+> | **Draft mode** | Yes — preview before publishing | No |
+> | **Community Themes browser** | Yes — curated themes with one-click install | No |
+> | **Sidebar / overlay transparency** | Yes — admin-controlled visual style valves | No |
+> | **Multi-worker support** | Yes — automatic Redis pub/sub for multi-worker SSE | No |
+> | **AI-driven theming** | No | Yes (`apply_theme()` tool method) |
+> | **Development status** | Actively developed | Maintenance mode |
+>
+> **Both versions share the same core functionality** — OKLCH palette engine, Canvas FX, gradient builder, custom CSS, and snapshot library.
+>
+> If you're an **admin** looking for instance-wide theming, this Event Function is for you. Add the optional **[Launcher Tool](../tools/theme_designer_pro_launcher.py)** companion to open the designer directly from chat.
+>
+> If you're a **regular user** who wants personal theme customization without admin access, use the **[Tool variant](../tools/)**.
+
+---
+
+Theme Designer Pro (Event Function) is a professional-grade theming engine for Open WebUI. It registers a standalone admin page at a configurable URL (default: `/api/v1/theme-designer`), persists themes server-side, and pushes changes to all connected clients in real-time via Server-Sent Events. Powered by the modern OKLCH color space, it generates perceptually uniform color palettes across Dark, OLED, Light, and Her modes simultaneously.
+
+Unlike the [Tool variant](../tools/) which runs inside an AI chat iframe, this variant runs as a native ASGI route — no iframe sandbox flags needed, no "Same Origin" configuration required.
+
+---
+
+## ✨ Key Features
+
+- ⚡ **Server-Side Persistence:** Themes are saved to `DATA_DIR/theme/` on the server and served through Open WebUI's shared static assets (`/static/loader.js` + `/static/custom.css`) — every user sees the same theme instantly, across all browsers and devices. Nothing is written to the frontend build.
+- 📡 **Real-Time SSE Push:** When you save a theme, all connected Open WebUI clients receive the update in real-time via Server-Sent Events. No page refresh required. Multi-worker deployments are supported via automatic Redis pub/sub broadcasting.
+- 📝 **Draft Mode:** Preview theme changes locally in your browser before publishing to all users. Draft mode isolates changes in `sessionStorage` — other users see nothing until you publish. The designer communicates with the bootloader via a `owui-theme-updated` CustomEvent for live preview without touching `localStorage`. Click **Publish** to push to all users, or discard to revert.
+- 🌈 **OKLCH Color Engine:** Harness Tailwind v4's OKLCH color spaces. Adjust Hue, Chroma, and Lightness to generate mathematically perfect, accessible tonal ramps. Hit **✦ Randomize** to generate random base colors instantly, or **◎ Extract** to upload/paste an image and calculate dominant colors using hue-histogram analysis. Locked variables are protected from both. _(Pro-Tip: Double-click any slider label to instantly reset it to its default value)._
+- 🖥️☀️🌌🌙❤️ **Multi-Mode Design Engine:** Switch between System, Dark, OLED, Light, and the elusive Her mode design views using the segmented toggle. A unified OKLCH foundation ensures your colors look mathematically perfect across all environments. _(Note: The 'Her' tab dynamically reveals itself by syncing with your Open WebUI administrator's `enable_easter_eggs` configuration via the `/api/config` endpoint)._
+- 🌓 **True OS Integration & System Mode:** The System mode acts as a proxy, automatically swapping between your Light and Dark designs based on Operating System preference. The engine generates CSS utilizing native `@media (prefers-color-scheme)` blocks, guaranteeing custom styles, variables, and Canvas FX seamlessly adapt even if browser class management is delayed.
+- 🔄 **Selective Cross-Mode Synchronization:** Instantly duplicate your setup from one mode to another using the "Sync" button. A powerful selective sync modal allows you to copy exactly what you need — OKLCH Palette, Variable Overrides, Custom CSS, Canvas FX, Gradient Background, or Auth Visibility — to any combination of target modes simultaneously. Colored delta badges show which settings differ between modes.
+- 🔄 **Live Cross-UI Detection:** If you change the Open WebUI theme natively (via OS settings or keyboard shortcuts) while the designer is open, the designer instantly switches its internal tab to match your live environment.
+- 🔑 **Auth Page Theming:** Selectively opt-in your custom theme components (Foundation Colors, Custom CSS, Canvas FX, and Gradient Background) to display on the Open WebUI Login and Signup screens. Each component has an independent "Show on Auth Pages" toggle.
+- 🎇 **Canvas FX Animations (Web Worker Powered):** Inject interactive JavaScript animations directly into the background of Open WebUI. Animations run on a Background Web Worker via `OffscreenCanvas` for zero-lag performance, with an automatic main-thread fallback for browsers that don't support `OffscreenCanvas`. The structural transparency layer makes native UI panels see-through so animations show behind the interface. Drag & drop `.js` files anywhere on the UI to import animations instantly.
+- 🔊 **Context-Aware Animations:** Canvas FX scripts can react to conversation data in real-time. A DOM observer scans chat messages for DOM-based token estimation (~2s debounce), while a Socket.IO WebSocket interceptor extracts exact token counts from `chat:completion` responses — both feed a `context` message to the animation for data-driven visual effects. External scripts can also dispatch custom context data via the `owui-canvas-context` CustomEvent API.
+- 🎭 **Community Themes Browser:** Browse and install curated community themes directly from the Themes tab. The community themes grid fetches from the [preset gallery manifest](https://github.com/silentoplayz/theme-designer-pro-presets) and supports one-click install, install-all, and search. Controlled by the `enable_community_themes` valve.
+- 🪟 **Sidebar & Overlay Transparency:** Admin-configurable transparency for the sidebar and overlay UI (settings modals, dropdowns). Choose between opaque (solid), translucent (frosted glass with backdrop-blur), or transparent modes via the `sidebar_transparency` and `overlay_transparency` valves.
+- 👩💻 **IDE-Grade Custom CSS Editor:** Write raw CSS directly within the tool. The editor features Tab trapping (2-space indent), smart auto-indentation, auto-closing pairs (brackets, quotes, parentheses), and a synced line number gutter. Save your favorite tweaks to the built-in Custom CSS Preset Gallery. A bundled "Tactical HUD" CSS preset — designed to pair with the "Tactical Liquid Grid" Canvas FX animation — ships with every fresh install as a starter example. Includes a smart parser that safely extracts and hoists `@keyframes`!
+- 🛡️ **Auto-Scoped CSS Injection:** Write Custom CSS without fear of breaking other modes. The Auto-Scope toggle automatically wraps your code in the correct CSS selectors (e.g., `.dark` or `[data-theme='light']`) to ensure tweaks only apply when they should. User CSS is automatically sanitized to prevent spoofing of internal `OWUI_*` marker comments used for auth-page stripping.
+- 🎯 **Variable Overrides & Manual CSS Variables:** Hand-pick and override color variables with a native color picker — each swatch features an `Aa` contrast preview badge. Click directly on any variable name to instantly copy its CSS declaration (e.g., `--color-gray-800: #1a1a2e;`). The Manual Variable Overrides code editor lets you write raw CSS custom property declarations injected _after_ the generated palette for maximum priority.
+- 🔒 **Smart Locking / Pinning:** Lock specific color variables using the 🔒 icon (or bulk "Lock All" / "Unlock All" buttons). Locked colors are pinned and protected from sliders, randomization, or image extraction.
+- 📋 **Smart Clipboard Parsing & Image Extraction:** Upload an image or press `Ctrl+V` to paste one from your clipboard to calculate dominant colors. The tool also features a Smart JSON paste listener — paste a Theme Designer JSON configuration, and the tool will parse and prompt you to apply it (with a security warning if untrusted Canvas FX scripts are detected).
+- 🎨 **Gradient Background Builder:** Design rich CSS gradient backgrounds using the dedicated Gradient tab. Choose between linear, radial, and mesh gradient types, add and position color stops visually, control direction and intensity, and enable smooth gradient animation with configurable speed. Ships with 12 built-in gradient presets — Midnight, Emerald, Amethyst, Sapphire, Aurora (animated), Sunset, Ocean, Neon, Nebula (mesh), Lagoon (mesh), Ember (mesh), and Arctic (mesh). Save, import, and export custom gradient presets. The gradient layer applies the same structural transparency rules as Canvas FX.
+
+- 📋 **Theme Metadata & Versioning:** Attach rich metadata when saving — Name, Description, Author, Theme Version, Target WebUI Version, Repository URL, and Theme Update URL. Metadata is embedded in exported `.json` files and preserved through imports.
+- 🔄 **OTA Theme Update Checking:** Themes with a Theme Update URL can be checked for updates against a remote JSON endpoint. Use the per-snapshot ⟳ button or the global "Updates" header button to check all themes at once. Shows a detailed update modal with version comparison.
+- 🌐 **Community Theme Import via URL:** Import themes directly from the web. The Import button opens a dual-mode dialog where you can paste a URL to a remote `theme.json` file, or use the classic file picker. Theme Designer Pro auto-converts `github.com` URLs to raw content.
+- 📦 **JSON Viewer:** Inspect your current theme state at any time. The JSON Viewer modal displays your full configuration in a read-only, formatted code block with Copy, Collapse, and validity badge indicators.
+- 📚 **Theme Library & Snapshots:** Save multiple "Snapshots" of your designs. Each snapshot captures your entire configuration (all modes, overrides, locks, manual variables, custom CSS, Canvas FX, and gradient background). Manage your library with inline Save, Import, Export, and Search buttons.
+- 🔍 **Library Search, Filter & Sort:** Find saved themes using search, filter by feature tags (Custom CSS, Canvas FX, Overrides, Linked/URL themes), and sort alphabetically or by creation order. The same search and filter functionality is available in the CSS Snippet and Canvas Script galleries. Rich tooltips show name, version, author, description, and feature tags.
+- 📦 **Mass Import, Export & Wipe Portability:** Download your entire snapshot library (or individual items) as smart backups. Mass-import via file picker, or drag & drop `.json`, `.js`, and `.css` files directly anywhere onto the designer window — files are automatically routed to the correct gallery (themes, canvas scripts, CSS snippets, or gradient presets). Each gallery has a "Trash" icon to wipe specific collections. Individual CSS files can also be imported and exported.
+- ⏪ **Undo & Redo History:** Step backward and forward through changes using the built-in Undo/Redo footer buttons or `Ctrl+Z` / `Ctrl+Y` / `Ctrl+Shift+Z` keyboard shortcuts. Press `Escape` to close any open modal, or `Enter` to confirm the primary action.
+- 📋 **CSS / Tailwind v4 Export:** The CSS Output tab provides Raw CSS and Tailwind v4 `@theme` block views, each with Minify toggle, Copy to Clipboard, and Download as `.css` file.
+- 👁️🗨️ **Self-Adapting UI & Contrast Protection:** The designer interface dynamically themes _itself_ based on the colors you pick. Built-in contrast protection shifts text and border colors to remain legible with ultra-washed-out palettes.
+- 🪄 **Native Open WebUI Aesthetic:** Meticulously designed to feel like a native part of Open WebUI, complete with custom-built, dependency-free tooltips and styled code blocks.
+- 📱 **Fully Responsive:** The designer adapts to mobile screens with three responsive breakpoints (≤768px tablets, ≤480px phones, ≤390px iPhone SE) including icon-only mode for narrow header buttons.
+- 💾 **Session Persistence:** The designer remembers which tab you were on via `sessionStorage`, so refreshing the page returns you to exactly where you left off.
+- ⏪ **Legacy Data Migration:** Automatically detects legacy data structures and gracefully migrates saved snapshots and active themes to the latest format without data loss.
+- 🔌 **Function Lifecycle Integration:** Toggling the function OFF in the admin panel triggers a clean `function.disable_started` lifecycle event that withdraws the theme CSS from the shared `custom.css`, broadcasts `theme-disable` to all connected clients, and clears `localStorage` — no page refresh needed. The loader fragment stays published in an inactive state so its SSE connection survives. Toggling back ON triggers `function.enable_started`, which republishes and broadcasts the theme to all clients immediately. Requires Open WebUI v0.11.0 or newer (pre-toggle lifecycle events).
+- ☢️ **Safe Nuclear & Factory Resets:** "Reset Mode" and "Global Reset" buttons safely clear all custom styling and restore Open WebUI to its original look. Confirmation dialogs offer pre-wipe backups. Factory Reset under the Documentation tab's Danger Zone permanently wipes all data.
+
+---
+
+## 🎭 Preset Gallery
+
+A curated community collection of ready-to-import presets is available at:
+
+**🔗 [github.com/silentoplayz/theme-designer-pro-presets](https://github.com/silentoplayz/theme-designer-pro-presets)**
+
+### Quick Import
+
+**Import everything at once** — paste this URL into any Import modal and click **Load URL**:
+
+```
+https://raw.githubusercontent.com/silentoplayz/theme-designer-pro-presets/main/bundles/everything.json
+```
+
+Or import individual categories:
+
+| Bundle | URL |
+|---|---|
+| All Canvas FX | `https://raw.githubusercontent.com/silentoplayz/theme-designer-pro-presets/main/bundles/canvas-fx-all.json` |
+| All CSS Presets | `https://raw.githubusercontent.com/silentoplayz/theme-designer-pro-presets/main/bundles/css-presets-all.json` |
+| All Themes | `https://raw.githubusercontent.com/silentoplayz/theme-designer-pro-presets/main/bundles/themes-all.json` |
+| All Gradients | `https://raw.githubusercontent.com/silentoplayz/theme-designer-pro-presets/main/bundles/gradients-all.json` |
+
+You can also import individual presets by pasting any file's GitHub URL directly — Theme Designer Pro auto-converts `github.com` URLs to raw content.
+
+---
+
+## 🚀 Installation
+
+1. Open your Open WebUI **Admin Panel**
+2. Go to **Functions**
+3. Click **Create New Function**
+4. Set the Type to **Event** (not Tool, not Filter)
+5. Copy the contents of [`theme_designer_pro_event.py`](theme_designer_pro_event.py) and paste it in
+6. Save — the designer is now available at `/api/v1/theme-designer`
+
+> **No sandbox flags required.** Unlike the Tool variant, this event function serves a native page via ASGI routes — no iframe, no "Same Origin" configuration needed.
+
+> [!WARNING]
+> **Running behind nginx or another reverse proxy?** You **must** add `proxy_buffering off;` to your nginx location block (or the equivalent for your proxy). Without this, SSE live push events are silently buffered and themes will only appear on the admin's browser — other users and devices will see no changes. This is the **#1 deployment issue**. See the in-app documentation (📖 Docs → Section 17: Reverse Proxy Configuration) for nginx, Caddy, Apache, and Traefik examples.
+
+### Optional: Launcher Companion Tool
+
+The [Launcher Tool](../tools/theme_designer_pro_launcher.py) is a lightweight companion that opens the designer page directly inside an Open WebUI chat via iframe — no need to navigate to the URL manually.
+
+1. Go to **Workspace** > **Tools** > **Create New Tool**
+2. Copy the contents of [`theme_designer_pro_launcher.py`](../tools/theme_designer_pro_launcher.py) and paste it in
+3. Save — now you can ask your AI: _"Open Theme Designer Pro"_ and it renders inside the chat
+
+> **Note:** The Launcher Tool requires the Event Function to be installed and running. It has its own `designer_url` valve that must match the Event Function's `designer_url` valve.
+
+---
+
+## 🛠️ Usage Instructions
+
+1. **Navigate to the Designer:** Open your browser and go to your Open WebUI instance's designer URL (default: `/api/v1/theme-designer`)
+2. **Design your Theme:**
+ - Use the **Segmented Toggle** to switch between System, Dark, OLED, Light, and Her mode design views
+ - Use the **Themes** tab to browse, install, and manage community themes and saved snapshots
+ - Use the sliders on the **Core Palette** tab to adjust your foundation colors, override individual color variables, and lock specific shades
+ - Hover and click over the **Tonal Ramp** to quickly copy mathematically generated HEX values
+ - Switch to the **Style Overrides** tab to write raw CSS tweaks
+ - Switch to the **Canvas FX** tab to inject interactive JavaScript background animations
+ - Switch to the **Gradient** tab to design gradient backgrounds using the visual builder
+ - Use the **JSON** header button to inspect or copy your full theme state
+ - Use the **Updates** header button to check all your themes for available updates
+3. **Draft vs. Live:** Toggle the **Draft** button in the header to preview changes locally before publishing. While in Draft mode, only your browser sees the changes. Click **Publish** to push to all users.
+4. **All changes auto-save.** Every change is debounced (250ms) and automatically persisted server-side via `syncToServer()`, then broadcast to all connected clients. In Draft mode, `syncToServer()` is gated off — changes are previewed locally only.
+
+**Pro-Tip for Custom CSS:** Not sure what to target? Press `F12` (or right-click > Inspect) to open your browser's Developer Tools. Use the element picker to find the exact class names used by Open WebUI (e.g., `.chat-bubble` or `#sidebar`).
+
+---
+
+## 🎨 Custom CSS: Changing Fonts
+
+You can change the global font family for your entire Open WebUI instance by pasting a CSS rule into the **Style Overrides** tab.
+
+Set the font on the document root and the form controls, then let it **inherit** down — form elements (`input`, `textarea`, `button`, `select`) are listed explicitly because they don't inherit `font-family` by default. Avoid painting the font onto the universal selector `*`: it clobbers icon fonts and code/math spans.
+
+**1. The "Native OS" Vibe** (Uses San Francisco on Mac, Segoe on Windows)
+
+```css
+html,
+body,
+input,
+textarea,
+button,
+select {
+ font-family:
+ -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, Helvetica, sans-serif !important;
+ letter-spacing: -0.01em !important;
+}
+```
+
+**2. The "Hacker Terminal" Vibe** (Forces monospace coding fonts)
+
+```css
+html,
+body,
+input,
+textarea,
+button,
+select {
+ font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', 'Courier New', monospace !important;
+}
+```
+
+**3. The "Editorial" Vibe** (Clean, highly readable Serif font)
+
+```css
+html,
+body,
+input,
+textarea,
+button,
+select {
+ font-family: 'Georgia', 'Cambria', 'Times New Roman', serif !important;
+ line-height: 1.65 !important;
+}
+```
+
+_Paste one of these into the Style Overrides editor for your desired mode, ensure "Enabled" is checked, and watch the UI font transform instantly!_
+
+---
+
+## 🔧 Valve Configuration
+
+Valves are configured in the Admin Panel under **Functions → Theme Designer Pro → ⚙️**.
+
+#### 🎛️ Feature Toggles
+
+| Valve | Type | Default | Description |
+|---|---|---|---|
+| **Enable Canvas FX** | `bool` | `true` | Allow Canvas FX (JavaScript background animations). When disabled, the Canvas FX tab is hidden and running animations are suppressed — canvas data is stripped from the saved state and a canvas-stripped update is broadcast. |
+| **Enable Custom CSS** | `bool` | `true` | Allow the Style Overrides (custom CSS) editor. When disabled, the Style Overrides tab is hidden in the designer UI. |
+| **Enable Gradient Builder** | `bool` | `true` | Allow the Gradient Background builder. When disabled, the Gradient tab is hidden in the designer UI. |
+| **Enable Community Themes** | `bool` | `true` | Show the Community Themes browser in the Themes tab. When disabled, the community themes grid is hidden and no manifest is fetched. |
+
+#### 🖌️ UX Policy
+
+| Valve | Type | Default | Description |
+|---|---|---|---|
+| **Enable Auth Page Theming** | `bool` | `true` | Allow theming the login/signup pages. When disabled, all "Show on Auth Pages" toggles are hidden and forced off. |
+| **Draft Mode Default** | `bool` | `false` | Open the designer in Draft mode by default. When enabled, the designer starts in Draft mode on every fresh page load, preventing accidental live changes. |
+| **Auto Sync** | `bool` | `false` | Skip the Selective Sync modal when loading presets or syncing. When enabled, a "Sync All" toggle appears in the designer footer — turn it on to propagate changes to all modes, or leave it off to apply only to the active mode. |
+
+#### 🎨 Visual Style
+
+| Valve | Type | Default | Description |
+|---|---|---|---|
+| **Sidebar Transparency** | `Literal` | `"opaque"` | Controls sidebar background style. `"opaque"` (default) — solid background for best readability. `"translucent"` — frosted glass effect (backdrop-blur) that lets backgrounds show through. `"transparent"` — fully see-through sidebar with no blur (automatically uses translucent on mobile for readability). |
+| **Overlay Transparency** | `Literal` | `"opaque"` | Controls overlay UI (settings modal, dropdowns, integration menus) background style. `"opaque"` (default) — solid background for best readability. `"translucent"` — frosted glass effect (backdrop-blur) that lets backgrounds show through. |
+
+#### 🔒 Security
+
+| Valve | Type | Default | Description |
+|---|---|---|---|
+| **Enable Canvas API Access** | `bool` | `false` | ⚠️ Gives every Canvas FX script **each viewer's own auth token**, not just yours. Canvas FX scripts run on every user's page, so a script can call the API as whoever is viewing. Scripts referencing `document` run on the main thread, outside a Worker's isolation, and an installed theme can replace its script later via its update URL — enabling this trusts every theme author on an ongoing basis. Only enable if you wrote or audited every installed script. When disabled (default), `env.authToken` is an empty string and everything else works. |
+| **Enable URL Import** | `bool` | `true` | Allow importing themes, CSS snippets, and canvas scripts from remote URLs. When disabled, all URL import buttons are hidden. |
+| **Allowed Import Domains** | `str` | `""` | Comma-separated allowlist of domains for URL imports (e.g., `raw.githubusercontent.com, openwebui.com`). Empty = allow all. Only applies when Enable URL Import is `true`. |
+
+#### 🛠️ Advanced
+
+| Valve | Type | Default | Description |
+|---|---|---|---|
+| **Designer URL** | `str` | `/api/v1/theme-designer` | URL path where the designer and all its sub-routes are served. Must start with `/api/v1/` — paths outside this prefix are auto-corrected to prevent the SPA catch-all from intercepting the route (a warning is logged). Changing this value triggers a route re-registration; the loader fragment picks up the new URL on its next compose. |
+
+> **Note:** All Valves default to their most permissive values — the event function behaves identically to an un-valved installation out of the box. Admins only need to configure Valves if they want to restrict specific features.
+
+> [!IMPORTANT]
+> Most valve changes take effect on the **next `event()` call** (i.e., any chat message or function event). Saving valve values alone doesn't trigger re-injection — it happens the next time the event function runs. The exception is the function **ON/OFF toggle** in the admin panel, which triggers `function.disable_started`/`function.enable_started` lifecycle events that take effect immediately (on Open WebUI v0.11.0 or newer).
+
+---
+
+## 📖 In-App Documentation
+
+The designer includes **22 comprehensive documentation sections** accessible via the **📖 Docs** button in the header. These cover:
+
+1. Getting Started & Architecture
+2. OKLCH Foundation & Modes
+3. System Theme & OS Integration
+4. Draft Mode & Publishing
+5. Variable Overrides & Locks
+6. Custom CSS & Auto-Scoping
+7. Canvas FX Animations (incl. Worker Protocol & API contract)
+8. Advanced Tools & Image Extraction
+9. Libraries & Data Management
+10. Theme Updates (OTA)
+11. Reference: Available Variables
+12. Gradient Backgrounds (incl. preset table)
+13. Structural Transparency & Layer Stack
+14. Keyboard Shortcuts & Editor Tips
+15. Compliance & Legal Disclaimer
+16. Community Presets (with import URLs)
+17. Reverse Proxy Configuration
+17b. Multi-Worker Deployments
+18. Troubleshooting & FAQ
+19. Uninstallation & Complete Removal
+20. Portability & Backups
+21. Danger Zone (Factory Reset)
+
+---
+
+## 🚀 How It Works (Under the Hood)
+
+Theme Designer Pro persists themes on the server and pushes changes to every connected client. Unlike the Tool variant, which operates through an iframe and browser `localStorage`, the Event Function publishes into Open WebUI's two admin-extensible static assets and composes them per request.
+
+> **Changed in 1.7.0.** Earlier versions wrote a bootloader and a `'),
+ (''),
+ ]
+ for start_marker, end_marker in markers:
+ while start_marker in content:
+ start = content.find(start_marker)
+ end = content.find(end_marker, start)
+ if end == -1:
+ break
+ end += len(end_marker)
+ if end < len(content) and content[end] == "\n":
+ end += 1
+ content = content[:start] + content[end:]
+ return content
+
+ # Cached result of _find_index_file() — index.html path never changes at runtime
+ _cached_index_path = None
+
+ def _find_index_file(self):
+ """Find the frontend index.html served by SPAStaticFiles."""
+ if Event._cached_index_path is not None:
+ return Event._cached_index_path
+
+ try:
+ from open_webui.env import FRONTEND_BUILD_DIR
+
+ idx = Path(FRONTEND_BUILD_DIR) / "index.html"
+ if idx.exists():
+ Event._cached_index_path = str(idx)
+ return Event._cached_index_path
+ except ImportError:
+ pass
+
+ # Fallback: guess common paths
+ fallbacks = [
+ "/app/backend/open_webui/frontend/index.html",
+ "/app/build/index.html",
+ "../build/index.html",
+ "./build/index.html",
+ ]
+ for path in fallbacks:
+ if os.path.exists(path):
+ Event._cached_index_path = path
+ return Event._cached_index_path
+ return None
+
+ # File-based lock to serialize all index.html read-modify-write operations
+ # across processes/workers. threading.Lock only protects within a single process,
+ # but Open WebUI fires event() from multiple concurrent contexts during startup.
+ _index_lock_path = None # Set lazily on first use
+
+ @classmethod
+ def _get_index_lock(cls):
+ """Return a context manager that acquires an exclusive file lock."""
+ import fcntl
+ from contextlib import contextmanager
+
+ @contextmanager
+ def _flock():
+ if cls._index_lock_path is None:
+ try:
+ from open_webui.env import DATA_DIR
+ cls._index_lock_path = Path(DATA_DIR) / "theme" / ".index.lock"
+ except ImportError:
+ cls._index_lock_path = Path("/tmp/.owui_index.lock")
+ cls._index_lock_path.parent.mkdir(parents=True, exist_ok=True)
+ fd = open(cls._index_lock_path, "w")
+ try:
+ fcntl.flock(fd, fcntl.LOCK_EX)
+ yield
+ finally:
+ fcntl.flock(fd, fcntl.LOCK_UN)
+ fd.close()
+
+ return _flock()
+
+ @staticmethod
+ def _atomic_write(path, content):
+ """Atomically write content to path via tempfile + os.replace."""
+ import tempfile as _tmpf
+ _fd, _tmp = _tmpf.mkstemp(dir=os.path.dirname(path), suffix='.tmp')
+ try:
+ with os.fdopen(_fd, 'w', encoding='utf-8') as f:
+ f.write(content)
+ os.replace(_tmp, path)
+ except BaseException:
+ try: os.unlink(_tmp)
+ except OSError: pass
+ raise
+
+ # -- shared static-asset fragments ---------------------------------------
+
+ # Marker pairs wrapping this plugin's block inside each composed asset, so
+ # asset_compose can strip a previous build's block before re-appending.
+ LOADER_BLOCK_START = "// owui-theme-designer-pro:start"
+ LOADER_BLOCK_END = "// owui-theme-designer-pro:end"
+ CSS_BLOCK_START = "/* owui-theme-designer-pro:start */"
+ CSS_BLOCK_END = "/* owui-theme-designer-pro:end */"
+
+ # Fixed literal, never derived from a build/function id — the shared-asset
+ # contract requires a stable key, because a key that changes per re-exec
+ # registers a SECOND entry and the output is emitted twice.
+ ASSET_KEY = "theme-designer-pro"
+
+ # asset_compose sorts fragments by (order, key); higher composes last. On
+ # custom.css that is the CSS cascade between plugins, and this plugin's
+ # custom-CSS section is documented as last = highest priority (Section 13),
+ # so it claims a high order explicitly rather than relying on where
+ # "theme-designer-pro" happens to fall alphabetically. On loader.js the
+ # same value makes this bootloader the outermost wrapper.
+ ASSET_ORDER = 100
+
+ @staticmethod
+ def _strip_canvas_scripts(state_str: str) -> str:
+ """Drop only the canvasScript bodies from a delivered state JSON string.
+
+ Measured on the largest Canvas FX script in the presets repo across four
+ modes, the scripts are 93% of the inlined state (129 KB of 139 KB) and
+ would make the loader fragment ~205 KB. asset_compose rebuilds and
+ md5-hashes the entire composed body on EVERY request — the ETag is
+ compared only after the producer has already run, so a 304 revalidation
+ costs almost exactly as much server CPU as a 200 (measured: 3.87 ms vs
+ 4.08 ms per request). Inlining the scripts would therefore charge every
+ page load of every user for a background animation that nobody can
+ perceive starting one round trip later.
+
+ Nothing flash-sensitive is lost. enforceTheme() reads CSS, not state,
+ and that CSS arrives via the render-blocking /static/custom.css.
+ _cssSections stays inlined (9 KB) because the auth page assembles its
+ CSS from it before the fetch lands. initCanvas() simply finds no script
+ on its first pass and starts the canvas when /state.json arrives.
+ """
+ try:
+ data = _json.loads(state_str)
+ if not isinstance(data, dict):
+ return state_str
+ stripped = False
+ for config in data.values():
+ # _cssSections is a sibling of the mode dicts and has no
+ # canvasScript, so it falls through untouched.
+ if isinstance(config, dict) and config.get("canvasScript"):
+ config.pop("canvasScript", None)
+ stripped = True
+ if not stripped:
+ return state_str
+ return _json.dumps(data, separators=(",", ":"))
+ except Exception:
+ return state_str # Unparseable state is served as-is by design
+
+ _bootloader_body_cache = None
+
+ @classmethod
+ def _bootloader_body(cls) -> str:
+ """BOOTLOADER_SCRIPT with its HTML comment + \s*$",
+ "",
+ cls.BOOTLOADER_SCRIPT.strip(),
+ flags=_re.DOTALL,
+ )
+ return cls._bootloader_body_cache
+
+ def _loader_fragment(self, active: bool) -> str:
+ """Producer for the /static/loader.js fragment.
+
+ Runs inside the request handler on every page load, so the whole result
+ is memoised and the steady state is a tuple compare. The two stat()s
+ behind _get_state_delivery are the only syscalls; its ETag stands in for
+ the state and sections mtimes plus the valves that affect delivery.
+
+ Stays published while the function is disabled, with __THEME_ACTIVE__
+ false: the bootloader strips the theme from a fresh load but keeps the
+ SSE connection, which is how a later re-enable reaches open tabs. The
+ CSS fragment is what goes empty on disable.
+ """
+ delivery = self._get_state_delivery() if active else None
+ cache_key = (
+ active,
+ self._get_route_base(),
+ self.valves.enable_canvas_api_access,
+ delivery[1] if delivery else None, # state delivery ETag
+ )
+ cached = Event._loader_fragment_cache
+ if cached and cached[0] == cache_key:
+ return cached[1]
+
+ js = self._bootloader_body().replace(
+ "__THEME_ROUTE__", cache_key[1]
+ ).replace(
+ "__CANVAS_API_ACCESS__",
+ "true" if self.valves.enable_canvas_api_access else "false",
+ ).replace(
+ "__THEME_ACTIVE__",
+ "true" if active else "false",
+ )
+
+ # State inlined as a JS string literal, minus the canvas scripts. Was a
+ #
+
+
+