Theme Designer Pro is an Event Function that themes your whole Open WebUI instance: color palettes, gradients, animated Canvas FX backgrounds and custom CSS. Admins design the instance theme every user sees, from the Themes tab in the Admin section of Settings or at {ROUTE_BASE} directly. With the Allow Personal Themes valve on, every user can also design a personal theme of their own (see Section 4). Themes are saved on the server and reach every open page live.
{ROUTE_BASE}?scope=me or from their Themes tab in Settings./static/loader.js and a safe subset of the theme CSS into /static/custom.css through a shared registry, composed fresh on every request (see Section 23). That subset holds the palette and your custom CSS, so they paint before Open WebUI draws its interface, with no flash. The state JSON, without Canvas FX scripts, is inlined into the loader too. On each load, the bootloader fetches {ROUTE_BASE}/theme.css and {ROUTE_BASE}/state.json for the full theme. localStorage keeps the last theme seen, applied before that fetch completes and kept as an offline fallback, so on a browser that has seen the theme before, the background animation starts at once; on a first visit it starts when state.json arrives. A personal theme keeps its own copy, tagged with the account it belongs to.DATA_DIR/theme/ as open_theme_designer.css, open_theme_designer.json, open_theme_designer_sections.json (structured CSS sections) and open_theme_designer_library.json. Personal themes use the same names in DATA_DIR/theme/users/<user id>/. Uploaded pictures are saved beside them as auth_background (the sign-in page picture) and page_background (the Other pages picture), and a personal theme keeps its own page_background in its folder. Saves hold DATA_DIR/theme/.save.lock so two workers never write at once. A theme file with bytes that aren’t UTF-8 is read with those bytes replaced, and the server logs a warning once per file; the next save that changes the theme writes it back as UTF-8. A library file that isn’t a JSON object is renamed to open_theme_designer_library.json.corrupt-<date>-<time> when the designer opens, including the one the Launcher loads out of sight to apply a chat theme, so the next gallery save can’t overwrite it, and the next designer page you see says which file it kept.{ROUTE_BASE}/events reconnects 3 seconds after a dropped connection, waits longer after an HTTP error such as a proxy’s 502 (doubling each time to a minute, then randomized by up to half either way, so at most about 90 seconds), and survives function hot-reloads. A personal theme save reaches only that user’s own pages, on every device they’re signed in on: each page claims its connection with its own sign-in token, so it works even when Open WebUI’s sign-in cookie is missing. With several workers, Redis carries the updates between them (see Section 22). Each worker accepts up to 8,192 connections; a page over that limit retries a minute later, fetching any change it missed each time, and still gets the theme on every load. A page whose connection comes back fetches what it missed over up to 2 seconds, so a restart doesn’t send every page at once.{ROUTE_BASE}. A designer doesn’t reload while you’re typing in one of its editors, while it’s saving or while it has a dialog open, and waits for that first, so what you typed is saved before it reloads. A save carries the whole theme, so the last save wins: a designer that saves while it waits replaces the other designer’s change with its own copy of every setting. It reloads at most once every 5 seconds, so a change made in several saves, as a Global Reset can be, ends in one more reload once that time is up. In Draft mode, it shows a message instead and keeps your draft. The save a designer makes on its own as it opens changes nothing for the others: an identical one is skipped, and any other is marked so they don’t reload for it. A designer whose live connection was cut, or refused by a proxy while Open WebUI restarted, reconnects on its own and reloads if a save landed while it was away.function.disable_started. Theme Designer Pro then broadcasts a theme-disable event that strips the theme from every open page. It also withdraws its CSS from /static/custom.css and removes the Themes tabs from open Settings dialogs. The loader stays published but inactive, so its live connection survives. Turning it back on fires function.enable_started, which republishes the CSS, reactivates the loader, and broadcasts the theme to every page.{ROUTE_BASE} (or {ROUTE_BASE}/me for a personal theme): a single change at once, and while you drag a slider, 250 ms after you stop. The server saves the CSS, sections and state files and broadcasts a version token; the next request for /static/loader.js or /static/custom.css already includes the save. Open pages fetch the new theme within a moment of the broadcast, spread over up to two seconds when many are connected so they don’t all ask at once. A page whose live connection dropped and came back, and every page after a Global Reset, fetches over the same spread. A page in a background tab fetches it when it’s shown again. A theme save the server doesn’t take, because the function is off or the save failed on the way (a server error or no connection), is never sent again on its own, since another designer may have saved since. The instance designer switches to Draft mode with a message, and the change waits there as a draft until you Publish it, after you turn the function back on if it was off. The personal designer, which has no Draft mode, holds its saves with a Retry bar; Retry sends them, and asks first if your theme was saved somewhere else since. The held theme is also kept in the browser tab, so a reload, or a designer in Settings that was closed, offers to save it when the personal designer next opens. A library change that fails waits on the page and goes with your next library change. When another designer saves the gallery, a page in Live mode reloads to show it. One that doesn’t reload, in Draft mode or holding a personal save, pauses its gallery saves until it reloads, since each one sends the whole gallery: it keeps the draft or the unsaved theme and says so. A gallery change still waiting then, or made while paused, is not saved, and the page says so after it reloads. One the server refuses, such as one over the size limit, says why. While a personal save or a library change waits, leaving or reloading the page asks first, and while a personal save waits the designer doesn’t reload for another tab’s save. A reset or Use instance theme drops what waits.sessionStorage to remember which tab you were working in, and restores it when you come back.h, c and l, and neither a dark nor a light mode) is read the same way from a file, a paste, a library backup or an install link./* tdp:isolated */ runs isolated: in a sandboxed frame with a policy that allows no requests, so it can draw but gets no cookies, storage, page or network, never runs on the page itself, and gets an empty env.authToken even with Enable Canvas Api Access on. Adding that line is a way to run a script you haven’t fully read. It needs a browser with OffscreenCanvas, and without one the script doesn’t run at all.{ROUTE_BASE}. /theme.css, /state.json, /events and reading /auth-background need no sign-in, because the sign-in page uses them. The designer page, saving the instance theme, /library.json, and changing /auth-background or /page-background are for admins. Any signed-in user except a pending account can use ?scope=me, /me and its /me/theme.css, /me/state.json, /me/library.json and /me/page-background, plus /consult, /events/bind and reading /page-background. A route takes the sign-in token as Authorization: Bearer or the token cookie, and a save needs Content-Type: application/json. A save, an upload or removal of a picture, /consult and /events/bind sent by a web page on another origin answer 403, because the browser sends the cookie from sibling sites too and Open WebUI’s default CORS lets any origin through. Over plain HTTP that check compares the page’s host with the forwarded Host or WEBUI_URL (see Reverse Proxy Configuration). Requests from scripts and curl, which send no Origin, are unaffected.Valves are set in Admin Panel > Functions > Theme Designer Pro > ⚙️. They take effect as soon as you save them: Open WebUI runs the function on save, and other workers pick the change up over Redis. Changes to Enable Canvas FX, Sidebar Transparency and Overlay Transparency are pushed to open pages right away. Other valve changes apply on each page’s next load. The designer reads the valves when its page loads, so reload an open designer to see a change there.
| Valve | Default | What It Does |
|---|---|---|
| Enable Canvas FX | On | Off: hides the Canvas FX tab, stops running animations, and serves every theme without its Canvas FX. The scripts stay saved. |
| Calm Chat Column | Off | On: each animation fades behind the chat by its own Center Calm setting. Off: every script’s Center Calm counts as 0, so animations show at full strength across the whole page. The scripts themselves are unchanged. The valve reaches a script through a line of the form const CENTER_CALM = <number>;, as the bundled presets write it; a script that keeps its calm amount anywhere else, such as in a CONFIG object, isn’t affected. |
| Enable Custom CSS | On | Off: hides the Style Overrides tab. Custom CSS that’s already saved keeps being served. |
| Enable Gradient Builder | On | Off: hides the Gradient tab. Gradients that are already saved keep being served. |
| Enable AI Consultant | On | Shows the AI button in the designer (see Section 5). |
| Enable Theme Update Checks | On | Off: hides the Updates button and each theme’s update check, and the designer makes no update requests (see Section 15). |
| Enable Community Themes | On | Off: hides the Community Themes browser and skips its catalog fetch (see Section 20). |
| Enable Auth Page Theming | On | Off: hides every Show on Auth Pages and Only on Auth Pages checkbox and turns them off, so login pages keep Open WebUI’s own look. Opening the designer while it’s off saves those checkboxes as off, so turning the valve back on leaves them off until you tick them again. |
| Draft Mode Default | Off | On: the instance designer opens in Draft mode on every load, reloads included, even after you publish (see Section 9). |
| Show In Admin Settings | On | Adds a Themes tab to the Admin section of Settings (see Section 3). |
| Show In Admin Panel | Off | Adds a Themes page to the Admin Panel’s top bar, between Functions and Settings (see Section 3). |
| Allow Personal Themes | Off | On: every user gets a Themes tab in their own Settings for a personal theme (see Section 4). Off again: everyone is back on the instance theme, and personal themes are kept. |
| Auto Sync | Off | On: Sync copies every part of the current mode to all the other modes without asking, and a gallery theme applies without the Apply Library Theme dialog. A Sync All switch in the footer then decides whether loading a theme or preset changes all four modes or only the current one. |
| Sidebar Transparency | opaque | The chat sidebar’s background: opaque, translucent (frosted glass) or transparent (turned into translucent on phones). Open WebUI’s fades at the top and bottom of the sidebar, above the user menu, show only while it’s opaque, with or without Canvas FX. |
| Overlay Transparency | opaque | Settings, menus and dialogs: opaque or translucent (frosted glass). The fade at the top of chats, under the chat title, shows only while it’s opaque, with or without Canvas FX. |
| Enable Canvas Api Access | Off | On: gives every Canvas FX script the viewing user’s Open WebUI token, so it can call the API as them. Leave it off unless you wrote or fully reviewed every script. |
| Enable Url Import | On | Shows the URL field and Load URL button in the import dialogs. A convenience switch in the browser, not a security boundary. |
| Allowed Import Domains | Empty | Comma-separated domains that URL imports, update checks and Community Themes may fetch from, each one with its subdomains. Empty allows any. Enforced in the browser as a guardrail, not a security boundary. |
| Designer Url | /api/v1/theme-designer | Where the designer is served. A path that doesn’t start with /api/v1/ is corrected to one that does, and characters other than letters, digits, /, _, . and - are removed. A path ending in /me is refused and the default is used instead, because personal themes use that name. After a change, the old address keeps serving the theme to pages that were already open, until Open WebUI restarts; the designer, saves and the library move to the new address at once. Uploaded Sign-in page and Other pages pictures move with it, saved themes included, so there’s no need to upload them again. |
| Ai Consultant Model | Empty | The model the AI Consultant asks, by its ID. Empty: the task model under Admin Settings > Interface (see Section 5). An ID that isn’t a model on this instance makes the AI Consultant answer with an error instead of falling back. |
Admins can open the designer without leaving Open WebUI: Settings has a Themes tab in its Admin section, right after Interface. It shows the same designer in a frame that fills the panel, and the Show In Admin Settings valve turns it off. The designer stays available at {ROUTE_BASE} either way.
translucent, the designer’s page turns clear, so Settings’ frosted glass shows behind it. It stays solid while you edit a mode whose light or dark look differs from Open WebUI’s, so its text stays readable.With the Allow Personal Themes valve on, every user can design a theme of their own from the Themes tab in the Personal section of Settings. It opens this designer on their own theme, marked My theme in the header.
DATA_DIR/theme/users/<user id>/, so it shows on every browser and device the user signs in from. Saving it updates their other open pages live, and nobody else’s.The AI button in the header turns a few words into a theme. Describe what you want, such as “warm copper” or “calm ocean at night”, and a model on your instance picks the hue, chroma and lightness, plus a matching gradient when the description suits one. You then fine-tune the result with the sliders.
The Theme Designer Pro Launcher is a companion Tool for theming from a chat. Describe a theme, such as “make my chat a koi pond” or “a forest green theme, like moss after rain”, and the Launcher builds a whole theme: a palette and accent in the colors asked for, an animated Canvas FX background picked from the presets catalog, frosted glass panels, or a gradient when it’s still. The chat shows it as a card with a live preview. Apply puts it on and adds it to the Theme Gallery, and Undo puts back the theme from before. Ask it to open the designer and it opens this designer in the chat instead.
/* tdp:isolated */, and Theme Designer Pro runs a marked script isolated: in a sandboxed frame with no origin and a policy that allows no requests, so it can draw but gets no cookies, storage, page or network, and never runs on the page itself. The card shows it as “(new)” with View code.WEBUI_SECRET_KEY for the one person who asked, and the designer applies only a theme with that hash, only for that person, within 30 days, and only where it was meant to land. The theme’s Canvas FX script comes from the catalog the server fetched or, when the chat model wrote it, runs isolated as described above, so Apply asks no second question about it. Links from Launchers before 2.0 carry colors alone and apply for five minutes.@import, a url(), image-set() or src() that isn’t a quoted data: URL such as url("data:…"), however it’s spelled or escaped, or a comment or string left open, and Apply saves nothing. A chat theme brings no Manual Overrides. A theme or CSS snippet from an install link gets the same check, its Manual Overrides included. CSS you write in the designer yourself, or bring in from a file, a paste or an address you type, isn’t checked, so it can still load fonts and images.launcher/ folder of the presets repository, whose README covers its valves.Unlike standard hex-based themes, this designer uses the OKLCH color space to generate perceptually uniform palettes. This means the visual "weight" of colors remains identical as you shift hues.
enable_easter_eggs setting from /api/config and shows the Her tab if it’s on, or if Open WebUI is already in Her mode.var(--tdp-accent), var(--tdp-accent-2) and var(--tdp-accent-3); click an accent’s name to copy its variable. Sync copies them with the palette.The System mode allows Open WebUI to automatically follow your Operating System's theme preference (Light vs. Dark).
@media (prefers-color-scheme) blocks for Dark and Light. This keeps your theme applied even if browser class management is delayed or overridden by the application.Draft Mode lets you preview and iterate on theme changes without pushing them live to users. It's designed for safe experimentation.
open_theme_designer.json), the instance designer says so and opens in Draft mode, on this tab’s Draft or the defaults. It does so on every load until the theme is replaced, and Publish asks before replacing it. The personal designer, which has no Draft mode, saves nothing until you change something. The server never stores a state that isn’t a JSON object: a theme save with one is refused. Undo on a chat card that applied a theme over it can’t put it back, and says so.sessionStorage, which only this tab can read, and never sent to the server. Other pages read the theme from the server, so the draft’s look stays in this tab. A library change made in Draft does reach the server, and other open designers reload to pick it up.sessionStorage, which is tab-scoped and destroyed when the tab closes. Within the same tab session, draft changes survive page refreshes. The last-published server-side theme remains active for everyone else.sessionStorage.While the OKLCH engine dynamically calculates a 12-step ramp, you can manually override any individual step in the Individual Variable Overrides section below the tonal ramp.
--color-gray-900: #hex;) to your clipboard.Directly under the tonal ramp, the Accessibility Contrast panel scores the four text-on-background pairs Open WebUI actually renders for the current mode: main and muted text on the page background, main text on panels, and main text on the sidebar. Each row shows a foreground-on-background swatch, the WCAG 2.1 contrast ratio, the steps compared (for example, 50 on 900), and a rating badge: AAA (≥7:1), AA (≥4.5:1), AA large (≥3:1, valid for large or bold text only), Fail, or Unknown for a color that only resolves in the live page, such as var(--…). A summary reports how many of the measured pairs clear AA. It recomputes live as you move a slider, edit an override, or switch modes.
Below the color picker grid, you'll find the Manual Variable Overrides code block. This feature is inspired by the legacy Open WebUI Theming system fork and gives power users direct control over CSS custom properties.
--color-gray-900: #1a1a2e;) that are injected after the generated palette, giving them final override priority.--variable-name: value; syntax. Comments (/* */ and //) are automatically skipped, and so are lines that don’t start with -- or that contain { or }. The designer appends !important for you.@media (prefers-color-scheme) support, ensuring they work correctly when the user's OS theme preference is set to System.Write raw CSS overrides in a code editor with auto-indentation and auto-closing pairs (brackets, parentheses, and quotes). Your CSS is saved per-mode. Use the Preset Gallery to save, rename, and manage reusable snippets.
:root and a bare html become &. @keyframes blocks are extracted and placed outside the wrapper. This prevents your Dark mode CSS from accidentally ruining your Light mode styling.:root references become :is(<mode selector>).@media (prefers-color-scheme) blocks for people on System.var(--tdp-accent), var(--tdp-accent-2) and var(--tdp-accent-3) for highlights instead of hex values. Every mode defines them, with the colors set under Accent Colors in the Core Palette tab or the ones generated from the palette, so one rule follows each mode and every later palette change..css files (up to 16 MB each) onto the designer to add them to the Preset Gallery as snippets, then load one to use it. Export your snippets to share them.You can change the global font family for your entire Open WebUI instance by pasting a CSS rule into the editor. Set the font on the document root and the form controls, then let it inherit down. Form elements (input, textarea, button, select) are listed too: browsers don’t pass the font to them, and while Open WebUI’s base styles do, listing them keeps the rule working if that changes. Avoid painting the font onto the universal selector *: it clobbers icon fonts and code/math spans. Here are a few quick examples:
Native OS (San Francisco / Segoe UI)
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;
}
Hacker Terminal (Monospace)
html, body, input, textarea, button, select {
font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', 'Courier New', monospace !important;
}
Editorial (Serif)
html, body, input, textarea, button, select {
font-family: 'Georgia', 'Cambria', 'Times New Roman', serif !important;
line-height: 1.65 !important;
}
A one-liner like * { border-radius: 2.5px !important; font-family: monospace !important; } works, but the universal selector plus !important is a blunt hammer. It's fine for a throwaway experiment and the wrong foundation for a reusable preset. Four rules of thumb keep overrides working across Open WebUI updates and other themes:
.app, not *. Open WebUI's signed-in interface lives inside .app (the designer page uses #theme-designer-container). The sign-in page (#auth-page) and shared chats are outside it, and so are dropdowns, submenus, modals and tooltips, which are portaled onto document.body. Your CSS already beats Tailwind’s utility classes, because Open WebUI puts them in a cascade layer and your CSS isn’t in one; scoping to .app adds specificity against Open WebUI’s other rules and leaves those portaled menus with their native, readable styling.*. Set font-family on html, body (plus the form controls) and it cascades everywhere. Putting it on * also overrides icon fonts and code/math spans.!important for the properties that need it. Your Style Overrides snippet comes after the palette, structural and gradient layers, but those layers mark their own declarations !important, so overriding a color, background or gradient they set needs !important too. For anything they don’t set, such as corner radius or spacing, you rarely need it.Blunt (breaks avatars & toggles)
* {
border-radius: 2.5px !important;
}
Targeted (corners tighten, circles survive)
.app :where([class*="rounded-"]:not([class*="rounded-full"])) {
border-radius: 2.5px;
}
::selection {
background: #FFFF00;
color: #000;
}
Note: there is no #app element in Open WebUI; it's .app (a class). Selectors targeting #app silently do nothing. See Section 18: Structural Transparency for the full container/portal layout.
Inject interactive JavaScript animations directly into the background of Open WebUI. The designer automatically applies a Structural Layer that makes native UI components transparent so the animation shines through.
OffscreenCanvas (if supported by your browser) to ensure high-performance rendering without blocking the UI thread. Both Canvas 2D and WebGL/WebGL2 contexts are supported: call canvas.getContext('2d') for standard drawing or canvas.getContext('webgl2') for GPU-accelerated shader rendering (see WebGL Rendering below). A script that uses the word document in its code, outside comments, is sent straight to the main thread. The status badge in the designer shows the predicted execution mode, from the browser’s capabilities and that text check: Background Worker (OffscreenCanvas), Main Thread (DOM Access) (the script contains document), Main Thread (Fallback) (the browser lacks OffscreenCanvas), Isolated Frame (the script starts with /* tdp:isolated */), or Won’t Run (No OffscreenCanvas) (an isolated script in a browser without OffscreenCanvas). If the Worker reports an uncaught error, the engine also moves the script to the main thread; the badge doesn’t change in that case, because it shows the prediction, not the live path. A script whose first characters are /* tdp:isolated */ is the exception to all of this: it always runs in a sandboxed frame (see Section 1, Canvas FX Security), even when it says document, and a Worker error stops it instead of moving it. Next to the status badge, a WebGL badge appears when the script asks for a WebGL context, a Context badge when it handles context messages, and a Follows Theme badge when it handles theme messages.self.onmessage: init, resize, mousemove, click, mousedown, mouseup, touchstart, touchmove, touchend, context, theme, motion and layout. Touch events also generate synthetic mouse equivalents for cross-device compatibility.CONFIG (or CFG) object or the constants at its top. A constant counts when its name is in capitals, it sits on a line of its own above the first function, class or onmessage line, and its value is a number, true/false, or a quoted '#rgb' or '#rrggbb' color. A comment line such as // ── Colors ── becomes a heading over the settings below it. A change rewrites that one value in the script, as if you had typed it, so the animation restarts with it. Reset to the script’s values puts back the script as it was before your first change, as long as you haven’t changed the script another way since, and Undo works too. A range written in the setting’s comment, such as (0.5-3), sets the slider’s range. While the Calm Chat Column valve is off, Open WebUI pages run every script with CENTER_CALM at 0, whatever its slider says..js animation files by dragging them into the designer. The gallery has search, a sort, and a type filter (All, WebGL, Context, Follows Theme, DOM Access).Your Canvas FX script runs inside a Web Worker with an OffscreenCanvas. The runtime communicates with your script using a structured message protocol via self.onmessage. Understanding this contract is essential for writing reliable animations.
Inbound Messages (Runtime → Your Script)
Thirteen message types are dispatched to your script's self.onmessage handler:
| Type | Payload | When |
|---|---|---|
init |
{ canvas, width, height, dpr, reducedMotion, column, env, theme } |
Fired once on startup. theme is the active mode's palette, the same object a theme message carries (see Theme-Aware Animations). canvas is an OffscreenCanvas transferred via postMessage. Call canvas.getContext('2d') for 2D drawing, or canvas.getContext('webgl2') (with 'webgl' fallback) for GPU-accelerated shader rendering. width and height are the initial viewport dimensions, in CSS pixels. dpr is the screen’s device pixel ratio, which a worker can’t read for itself: size the canvas at width * dpr for sharp lines, within a pixel budget, since the canvas element is stretched to the viewport either way. reducedMotion is true when the viewer has asked their system to reduce motion; slow the animation down, drop flashes and sudden movement, or hold it still. column is where the chat column sits, as { x, width, left, right } in CSS pixels: its center and width, and the left and right edges of the chat area around it, which leave out the sidebar. width is never more than Open WebUI’s usual 58rem, even when widescreen mode stretches the chat across the window, and in a window too narrow for margins it narrows further, down to 320 px at the least, until a band of width / 2 + 56 fading out by 1.2 times that ends a strip short of each edge of the chat area (56 px or 8% of the chat area’s width, whichever is larger), so the margins beside it stay lively. It is null on a page without a chat. With the sidebar open the column sits right of the screen’s center, so keep your calm band on it, and put focal points in the margins between left and the column or the column and right, where the sidebar won’t cover them. env provides runtime context: { authToken, baseUrl, locale, timezone }. authToken is the token of whichever user is viewing the page, and is an empty string unless an admin has enabled the Enable Canvas Api Access valve, or always for an isolated script. A script given it can call the Open WebUI API as that user. theme can be null if the palette couldn’t be built, so check it before reading its colors. |
resize |
{ width, height, dpr } |
Fired 150 ms after the browser window stops resizing, and after a zoom, which changes dpr. Update your internal width/height and canvas.width/canvas.height accordingly. In main-thread mode, the engine resizes the canvas element itself first. |
mousemove |
{ x, y } |
Fired on cursor movement (throttled to once per requestAnimationFrame). Coordinates are clientX/clientY (viewport-relative). Also fired by touchmove (first finger) for cross-device compatibility, and by a framed page that posts { type: 'owui-canvas-mousemove', x, y } to the window, which is how the designer forwards the cursor when it’s shown inside Settings or a chat. |
click |
{ x, y } |
Fired on a click, after its mousedown and mouseup. To answer a click or tap, use mousedown alone, so one tap acts once. |
mousedown |
{ x, y } |
Fired when a mouse button is pressed. Also fired synthetically on touchstart (first finger), and the browser can send its own after a tap, so one tap can arrive as two. Use with mouseup for drag interactions. |
mouseup |
{ x, y } |
Fired when a mouse button is released. Also fired synthetically on touchend (first finger). |
touchstart |
{ touches: [{x, y}, ...] } |
Fired when a finger touches the screen. The touches array contains all current touch points, enabling multi-touch interactions. Also generates a synthetic mousedown. |
touchmove |
{ touches: [{x, y}, ...] } |
Fired on finger movement (throttled to once per requestAnimationFrame). Also bridges to mousemove (first finger) so mouse-only scripts work on touch devices. |
touchend |
{ touches: [{x, y}, ...] } |
Fired when a finger is lifted. The touches array contains the changedTouches (fingers that were removed). Also generates a synthetic mouseup. |
context |
{ messages, chars, estimatedTokens } or { exactTokens, promptTokens, completionTokens, source } |
The first shape is the engine’s estimate from the page: sent right after init and when you switch chats, then at most every 2 seconds while the chat changes, during a streaming reply too, and only when a count changed. The second shape carries exact counts from the server after a reply (see Context-Aware Animations). messages counts the user and assistant messages in the chat, chars is the total character count of the user and assistant messages, and estimatedTokens is chars / 4, rounded up. Enables context-aware animations that grow or change as the conversation progresses. External scripts can also dispatch custom data via window.dispatchEvent(new CustomEvent('owui-canvas-context', { detail: { ... } })). |
theme |
{ mode, dark, hue, chroma, colors, rgb, ramp } |
Fired when the palette changes while your script runs: a switch to a mode that uses the same script, a theme update, or a palette edit in this designer. The same object also arrives with init as e.data.theme. Handling it is optional; a script that ignores it keeps its own colors. See Theme-Aware Animations. |
motion |
{ reducedMotion } |
Fired when the viewer turns the system’s reduce-motion setting on or off while your script runs. The starting value arrives with init. |
layout |
{ column } |
Fired when the chat column moves or changes width: the sidebar opening or closing, Widescreen Mode, a resize, or a page with or without a chat. column is { x, width, left, right } or null, as in init. |
Messages Back to the Page
The runtime doesn’t listen to anything your script posts back with self.postMessage(). A script needs no heartbeat or keepalive to keep running, and the house validator fails a script that sends one.
Animation Loop
requestAnimationFrame() is available inside Web Workers that hold an OffscreenCanvas. Use it for your render loop. Avoid using setInterval for rendering: requestAnimationFrame syncs to the display refresh rate, and whenever the page stops getting frames, because its tab is hidden or its window is covered, the runtime holds its callbacks until frames come back. Firefox doesn’t pause a worker’s frames on its own, and a page that keeps drawing unseen can fill the GPU’s memory. A setInterval loop keeps drawing all the same.
Lifecycle & Cleanup
The runtime terminates the worker and revokes its Blob URL when the script or its enabled state changes: switching to a mode with a different script, turning Canvas FX off, or opening a login page where Show on Auth Pages is off; entering Open WebUI while Only on Auth Pages is on; or removing the theme. Switching between modes that use the same script keeps the running worker. In a Worker, termination is immediate, so your script doesn’t need to clean up after itself. On the main thread nothing is terminated: only the engine’s own listeners and the script’s bare timer and frame calls are cleared, so a script that adds its own listeners or elements there must remove them itself.
Main Thread Fallback
Your script runs on the main thread in three cases: (1) the browser doesn’t support OffscreenCanvas, (2) the script uses the word document outside comments, or (3) the Worker reports an uncaught error. This is not a sandbox: the script runs inside a function on the page itself, with full access to window, document, cookies and localStorage. In this mode:
canvas in the init message is a standard <canvas> DOM element (not an OffscreenCanvas).self object is provided with onmessage, addEventListener('message', fn) and a no-op postMessage. A bare onmessage = fn assignment works too.requestAnimationFrame, setInterval and setTimeout calls are tracked and cleared on teardown. Call them as bare functions: self.requestAnimationFrame doesn’t exist on the main thread.self.onmessage = … or onmessage = …. Declaring it with let, var or function onmessage collides with the engine’s own and throws.self.onmessage pattern and don’t rely on Worker-specific APIs beyond what’s listed here.Minimal Script Template
/**
* Title: My Animation
* Description: One line on what it draws and how it responds.
*/
/* ────────── CONFIGURABLE VARIABLES ────────── */
const COUNT = 60; // how many motes (10-300)
const SPEED = 40; // rising speed, in px per second (5-200)
const CENTER_CALM = 0.7; // how much they fade behind the chat column (0-1)
const FOLLOW_THEME = true; // take the color from the theme's palette
/* ──────────────────────────────────────────── */
let canvas, ctx, w = 0, h = 0, dpr = 1;
let reduced = false, last = 0, column = null;
let color = '#8ab4ff', dark = true;
const mouse = { x: -10000, y: -10000 };
const xs = new Float32Array(COUNT), ys = new Float32Array(COUNT);
function applyTheme(t) {
if (!t) return;
dark = t.dark !== false;
if (FOLLOW_THEME && t.colors) color = t.colors.accent;
}
function size() {
canvas.width = Math.max(1, Math.round(w * dpr));
canvas.height = Math.max(1, Math.round(h * dpr));
ctx.setTransform(dpr, 0, 0, dpr, 0, 0);
for (let i = 0; i < COUNT; i++) { xs[i] = Math.random() * w; ys[i] = Math.random() * h; }
}
// 1 - CENTER_CALM over the chat column, easing back to 1 by 1.25 times its
// half-width, the same band as the reference script nebula_webgl.js
function calm(x) {
const cx = column ? column.x : w / 2, half = column ? column.width / 2 + 56 : 520;
const d = Math.min(1, Math.max(0, (Math.abs(x - cx) / half - 0.55) / 0.7));
return 1 - CENTER_CALM * (1 - d * d * (3 - 2 * d));
}
function frame(now) {
requestAnimationFrame(frame);
const dt = last ? Math.min((now - last) / 1000, 0.1) : 0;
last = now;
const speed = reduced ? SPEED * 0.2 : SPEED;
ctx.clearRect(0, 0, w, h);
ctx.fillStyle = color;
for (let i = 0; i < COUNT; i++) {
ys[i] -= speed * dt;
if (ys[i] < -4) ys[i] = h + 4;
ctx.globalAlpha = (dark ? 0.8 : 0.5) * calm(xs[i]);
ctx.fillRect(xs[i], ys[i], 3, 3);
}
ctx.globalAlpha = 1;
}
self.onmessage = (e) => {
const d = e.data;
switch (d.type) {
case 'init':
canvas = d.canvas;
ctx = canvas.getContext('2d');
w = d.width; h = d.height; dpr = Math.min(d.dpr || 1, 2);
reduced = !!d.reducedMotion;
column = d.column || null;
applyTheme(d.theme);
size();
requestAnimationFrame(frame);
break;
case 'resize':
w = d.width; h = d.height; dpr = Math.min(d.dpr || 1, 2);
size();
break;
case 'theme':
applyTheme(d);
break;
case 'motion':
reduced = d.reducedMotion;
break;
case 'layout':
column = d.column || null;
break;
case 'mousemove':
mouse.x = d.x; mouse.y = d.y;
break;
case 'mousedown':
// A click or tap at d.x, d.y. Every click on the page arrives here,
// the Send button's too, so keep the response gentle.
break;
}
};
The Canvas FX engine includes a built-in context data channel that lets your animation react to the live state of the chat conversation. This enables a powerful category of themes: visuals that grow, fill, or evolve as the user’s context window fills up, providing an ambient visual indicator of how much context remains.
How It Works
The engine provides two complementary data sources for context tracking, both delivered as context messages to your script. They run only for a script that names the string 'context' outside comments, as case 'context': does; the Context badge shows the same test.
1. DOM Observer (every 2 seconds, during streaming)
A MutationObserver on the #messages-container element watches for message changes. A change starts a 2-second timer if none is running; when it ends, the observer scans the .chat-user and .chat-assistant areas and sends:
{ type: 'context', messages: 8, chars: 12400, estimatedTokens: 3100 }
messages: the number of user and assistant messages in the chatchars: total character count across all user and assistant messagesestimatedTokens: a rough token estimate, chars / 4 rounded up2. Socket Interceptor (exact, after each response)
The engine intercepts WebSocket messages from Open WebUI’s Socket.IO connection. When a Socket.IO event carries usage data, the exact token counts are forwarded. For streamed replies from OpenAI-compatible connections, Open WebUI asks for that data only when the model’s Usage capability is on; Ollama replies report it either way. Like Open WebUI, the engine keeps only events for the chat in view, including a new chat that has no /c/ address yet, and skips the shared copy a chat sends to your other tabs. The counts are best-effort: the engine hears the socket from its first send after a context-reading script first starts on the page. That comes at once for a reply this tab starts (Open WebUI’s socket sends every second while it streams), but a reply this tab didn’t start, such as one in another tab, one still streaming across a reload, or one started through the API, can be missed for about half a minute at default settings (the socket’s ping interval, WEBSOCKET_SERVER_PING_INTERVAL, is 25 seconds and its heartbeat 30), and the estimate stands. Once installed, the hook stays for the page’s life and does nothing while no script reads context.
{ type: 'context', exactTokens: 137, promptTokens: 48, completionTokens: 89, source: 'socket' }
exactTokens: usage.total_tokens, or the prompt + completion sum when total_tokens is absentpromptTokens / completionTokens: exact breakdown (supports OpenAI-style prompt_tokens/completion_tokens and Anthropic-style input_tokens/output_tokens field names)source: always 'socket' to distinguish from DOM estimatesYour script receives both. The DOM observer sends an estimate at most every 2 seconds, so the character count grows during a streaming reply, while the socket interceptor sends an exact snapshot after each response completes. Prefer exactTokens when available, and keep it in a variable: the next estimate arrives within 2 seconds and has no exactTokens, so reading both from the same message lets the estimate replace the exact count at once.
When the chat container leaves the page, for example on a new empty chat, the DOM observer sends { messages: 0, chars: 0, estimatedTokens: 0 }. Switching between two chats that both have messages simply delivers the new chat’s counts. Socket token counts aren’t reset when you change chats.
Building a Growth Animation
The core pattern is simple: compute a growth ratio (0 to 1) from the estimated tokens vs. your model’s context limit, then map that ratio to visual stages in your animation. Here’s the recommended approach:
const MAX_TOKENS = 128000; // adjust to your model's context limit
const GROWTH_SPEED = 1; // set to 10-50 for fast testing
let contextRatio = 0; // smoothed 0-1 value
let targetRatio = 0; // raw target from context events
let exactTokens = 0; // the last exact count from the server
let estimatedTokens = 0; // the last estimate from the page
// In your message handler:
case 'context':
if (e.data.messages === 0) { exactTokens = 0; estimatedTokens = 0; } // an empty chat
if (e.data.exactTokens != null) exactTokens = e.data.exactTokens;
if (e.data.estimatedTokens != null) estimatedTokens = e.data.estimatedTokens;
// Exact counts arrive after each reply; estimates fill in until the first one
targetRatio = Math.min(1, ((exactTokens || estimatedTokens) / MAX_TOKENS) * GROWTH_SPEED);
break;
// In your render loop (smooth interpolation):
contextRatio += (targetRatio - contextRatio) * 0.01;
// Then use contextRatio to drive visual stages:
if (contextRatio < 0.1) { /* seed / empty state */ }
else if (contextRatio < 0.4) { /* early growth */ }
else if (contextRatio < 0.7) { /* mid growth */ }
else if (contextRatio < 0.9) { /* full growth */ }
else { /* warning: context nearly full */ }
Design Ideas
Any visual metaphor that has a recognizable progression from “empty” to “full” works well. Some examples:
| Theme | Growth Metaphor | Warning State |
|---|---|---|
| Sunflower | Seed → sprout → stem → leaves → bud → full bloom | Petals droop, sky turns red |
| Mushroom Farm | Mycelium threads → pins → caps → bioluminescent clusters | Spore cloud thickens, red pulse |
| Bathtub | Empty tub → water rising → bubbles → overflowing | Water overflows the rim |
| Wheat Field | Bare soil → seedlings → tall stalks → golden harvest | Field catches fire |
| Hourglass | Sand flowing from top to bottom, grains accumulating | Final grains falling, red glow |
Tips
ratio += (target - ratio) * 0.01), the animation will jump abruptly between states.GROWTH_SPEED for testing. At MAX_TOKENS = 128000, you’d need a very long conversation to see full growth. Set GROWTH_SPEED = 50 during development so a few messages take you through the entire lifecycle.growStart offset so they don’t all appear simultaneously. This creates a much more natural, organic feel.contextRatio > 0.85, add a visual cue (color shift, pulsing glow, drooping) so the user knows context is running low. That warning is the point of the feature.~3.1k / 128k tokens with a mini progress bar gives precise context alongside the ambient visual metaphor.messages: 0, and another chat with messages sends its own counts. Your animation should ease to the new value, or snap instantly, depending on the metaphor.Custom Event API
External scripts (Open WebUI event functions, tools, or browser extensions) can also send context data directly to the Canvas FX script, alongside the built-in DOM observer, while a Canvas FX script that reads context is running (one that names the string 'context' outside comments). Other scripts don’t receive these events. This is useful if you have access to exact token counts from API responses:
// From any script running on the Open WebUI page:
window.dispatchEvent(new CustomEvent('owui-canvas-context', {
detail: {
messages: 12,
chars: 48000,
estimatedTokens: 12000,
// You can include any extra fields; they're forwarded as-is
exactTokens: 11847,
maxContext: 128000
}
}));
The engine forwards the entire detail object to your Canvas FX script as a context message. Your script can read any custom fields you include. Don’t put a type field in detail: it replaces context.
The engine hands your script the active mode’s palette, so an animation can draw in the theme’s colors instead of its own. Change the hue in the Core Palette tab and a theme-aware animation recolors as you drag; switch from Dark to Light and it follows. It is opt-in: a script that never reads the palette keeps drawing exactly as it always has.
When It Arrives
init, as e.data.theme, so the first frame can already use it.theme message whenever it changes while your script runs: a mode switch that keeps the same script, a theme update from the server, or a palette edit here. It is only sent when something in it changed.Payload
{
type: 'theme',
mode: 'dark', // 'dark', 'oled', 'light' or 'her'
dark: true, // false on Light and Her: dark text on a light page
hue: 265, // the palette's hue, 0-360
chroma: 0.025, // the palette's chroma, 0 for a neutral theme
colors: { // '#rrggbb', for 2D canvas styles
background, surface, text, muted,
accent, accent2, accent3
},
rgb: { ... }, // the same colors as [r, g, b] from 0 to 1, for WebGL
ramp: { '50': '#...', ..., '950': '#...' } // the --color-gray-* ramp
}
background: the page color for this mode. surface: one step raised, like the input bar. text and muted: the main and secondary text colors.accent: the palette’s hue at a color made for the mode, lighter on dark modes and deeper on light ones, at four times the palette’s chroma, kept between 0.06 and 0.18. accent2 and accent3 sit 40° to either side of it. A theme at Chroma 0, or a mode with its palette off, gets gray accents.followTheme on instead of hard-coding the theme’s colors. The theme’s CSS gets the same three as var(--tdp-accent), var(--tdp-accent-2) and var(--tdp-accent-3).The Pattern
const CONFIG = {
followTheme: true, // Draw in the theme's colors when the designer sends them (true/false)
};
let colors = { bg: '#000000', glow: '#66ccff' }; // your own defaults
let light = false;
function applyTheme(t) {
if (!CONFIG.followTheme || !t || !t.colors) return;
colors = { bg: t.colors.background, glow: t.colors.accent };
light = t.dark === false;
// Rebuild anything cached in the old colors here
}
// In your message handler:
case 'init':
// ...set up the canvas...
applyTheme(e.data.theme);
break;
case 'theme':
applyTheme(e.data);
break;
followTheme: false turns it off, so the script must still draw well in its own colors.theme message can arrive mid-animation. Swap the colors and rebuild cached gradients or sprites, but keep particles and positions where they are.dark is false the animation sits behind dark text on a light page. Additive blending such as 'lighter' disappears there, so draw with 'source-over' and keep alphas modest.rgb entries straight to uniform3fv.A script that handles theme messages gets a Follows Theme badge in the editor and matches the preset gallery’s Follows Theme filter, and the website’s Studio shows followTheme as a switch with the rest of a script’s settings.
Canvas FX scripts are not limited to the 2D Canvas API. Since OffscreenCanvas supports WebGL and WebGL2 contexts, your scripts can run full GLSL fragment shaders on the GPU, for effects that are impossible or impractical with 2D canvas: raymarching, domain-warped fractal noise, volumetric lighting, metallic reflections, and real-time fluid simulations.
Why WebGL?
| Canvas 2D | WebGL | |
|---|---|---|
| Execution | CPU, single-threaded | GPU, massively parallel |
| Per-pixel math | getImageData (slow) |
Fragment shader (native) |
| Noise / fractals | ~10fps for 6-octave FBM | 60fps trivially |
| Effects possible | Particles, lines, fills | Raymarching, volumetrics, fluid sim, SDF |
Minimal WebGL Template
/**
* Title: My Shader
* Description: Soft drifting bands in the theme's accents that stay calm behind the chat.
*/
/* ────────── CONFIGURABLE VARIABLES ────────── */
const INTENSITY = 0.6; // how strongly it shows (0-1)
const SPEED = 1; // overall speed (0-3)
const CENTER_CALM = 0.7; // how much it fades behind the chat column (0-1)
const FOLLOW_THEME = true; // take the colors from the theme's palette
const RENDER_SCALE = 0.5; // resolution of the soft bands (0.25-1)
/* ──────────────────────────────────────────── */
let canvas, gl, prog, uTime, uRes, uCol, uAlpha, uC1, uC2;
let w = 0, h = 0, t = 0, last = 0, reduced = false, column = null, lost = false;
let c1 = [0.45, 0.6, 1], c2 = [0.7, 0.45, 0.95], dark = true;
const VERT = 'attribute vec2 a;void main(){gl_Position=vec4(a,0.,1.);}';
const FRAG = [
'#ifdef GL_FRAGMENT_PRECISION_HIGH',
'precision highp float;',
'#else',
'precision mediump float;',
'#endif',
'uniform float u_time;',
'uniform vec2 u_res;',
'uniform vec2 u_col;', // the chat column's center x and calm half-width, in render pixels
'uniform float u_alpha;',
'uniform vec3 u_c1;',
'uniform vec3 u_c2;',
'void main(){',
' vec2 uv = gl_FragCoord.xy / u_res;',
' float wave = 0.5 + 0.5 * sin(uv.y * 6.0 + u_time * 0.4 + sin(uv.x * 4.0 + u_time * 0.3));',
' float band = abs(gl_FragCoord.x - u_col.x) / u_col.y;',
' float calm = 1.0 - ' + CENTER_CALM.toFixed(3) + ' * (1.0 - smoothstep(0.55, 1.25, band));',
' float a = u_alpha * calm * smoothstep(0.6, 1.0, wave);', // only the crests, so the theme shows between them
' gl_FragColor = vec4(mix(u_c1, u_c2, wave) * a, a);', // premultiplied, so the theme shows through
'}'
].join('\n');
function shader(type, src) {
const sh = gl.createShader(type);
gl.shaderSource(sh, src);
gl.compileShader(sh);
if (!gl.getShaderParameter(sh, gl.COMPILE_STATUS)) { console.error(gl.getShaderInfoLog(sh)); return null; }
return sh;
}
function setup() {
const vs = shader(gl.VERTEX_SHADER, VERT), fs = shader(gl.FRAGMENT_SHADER, FRAG);
if (!vs || !fs) return false;
prog = gl.createProgram();
gl.attachShader(prog, vs);
gl.attachShader(prog, fs);
gl.linkProgram(prog);
if (!gl.getProgramParameter(prog, gl.LINK_STATUS)) { console.error(gl.getProgramInfoLog(prog)); return false; }
gl.useProgram(prog);
// One triangle that covers the whole viewport
gl.bindBuffer(gl.ARRAY_BUFFER, gl.createBuffer());
gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([-1, -1, 3, -1, -1, 3]), gl.STATIC_DRAW);
const a = gl.getAttribLocation(prog, 'a');
gl.enableVertexAttribArray(a);
gl.vertexAttribPointer(a, 2, gl.FLOAT, false, 0, 0);
uTime = gl.getUniformLocation(prog, 'u_time');
uRes = gl.getUniformLocation(prog, 'u_res');
uCol = gl.getUniformLocation(prog, 'u_col');
uAlpha = gl.getUniformLocation(prog, 'u_alpha');
uC1 = gl.getUniformLocation(prog, 'u_c1');
uC2 = gl.getUniformLocation(prog, 'u_c2');
return true;
}
function size() {
canvas.width = Math.max(1, Math.round(w * RENDER_SCALE));
canvas.height = Math.max(1, Math.round(h * RENDER_SCALE));
}
function applyTheme(d) {
if (!d) return;
dark = d.dark !== false;
if (FOLLOW_THEME && d.rgb) { c1 = d.rgb.accent; c2 = d.rgb.accent2; }
}
function frame(now) {
requestAnimationFrame(frame);
const dt = last ? Math.min((now - last) / 1000, 0.1) : 0;
last = now;
if (lost || !prog) return;
// Wrapped at a whole number of the waves' cycles, so the wrap is seamless
t = (t + dt * SPEED * (reduced ? 0.2 : 1)) % 628.3185;
const cx = column ? column.x : w / 2, half = column ? column.width / 2 + 56 : 520;
gl.viewport(0, 0, canvas.width, canvas.height);
gl.uniform1f(uTime, t);
gl.uniform2f(uRes, canvas.width, canvas.height);
gl.uniform2f(uCol, cx * RENDER_SCALE, half * RENDER_SCALE);
gl.uniform1f(uAlpha, INTENSITY * (dark ? 0.5 : 0.3));
gl.uniform3fv(uC1, c1);
gl.uniform3fv(uC2, c2);
gl.drawArrays(gl.TRIANGLES, 0, 3);
}
self.onmessage = (e) => {
const d = e.data;
switch (d.type) {
case 'init': {
canvas = d.canvas;
w = d.width; h = d.height;
reduced = !!d.reducedMotion;
column = d.column || null;
applyTheme(d.theme);
const opts = { premultipliedAlpha: true, antialias: false, depth: false, powerPreference: 'low-power' };
gl = canvas.getContext('webgl2', opts) || canvas.getContext('webgl', opts);
if (!gl) { console.warn('My Shader: WebGL is unavailable'); return; }
canvas.addEventListener('webglcontextlost', (ev) => { ev.preventDefault(); lost = true; });
canvas.addEventListener('webglcontextrestored', () => { lost = !setup(); });
size();
setup();
requestAnimationFrame(frame);
break;
}
case 'resize':
w = d.width; h = d.height;
if (canvas) size();
break;
case 'theme':
applyTheme(d);
break;
case 'motion':
reduced = d.reducedMotion;
break;
case 'layout':
column = d.column || null;
break;
}
};
Key Differences from 2D Scripts
canvas.getContext('webgl2') with a 'webgl' fallback instead of '2d'.'\n'.[-1,-1, 3,-1, -1,3] covers the entire viewport without quad seam artifacts.u_time (float), u_res (vec2), and u_mouse (vec2, normalized 0 to 1) to the shader. Flip mouse Y for GL coordinates: 1.0 - (e.data.y / h).iTime→u_time and iResolution.xy→u_res, call ShaderToy’s mainImage(fragColor, gl_FragCoord.xy) from your own main(), and write the result to gl_FragColor. ShaderToy’s iMouse is a pixel-based vec4, while u_mouse here is a normalized vec2, so convert where the shader uses it.OffscreenCanvas, canvas.getContext('webgpu') works too. The WebGL badge doesn’t detect WebGPU scripts.Shader Techniques Reference
a + b * cos(6.28 * (c*t + d)) generates smooth, curated color gradients from four vec3 parameters.1.0 - dot(uv - 0.5, uv - 0.5) * strength darkens edges for a natural focal effect.These utilities sit across the designer: Randomize and Extract under the palette sliders, { } JSON in the header, Undo, Redo and the resets in the footer, and Factory Reset in the Danger Zone.
Theme Designer Pro features isolated libraries for Themes, Custom CSS, Canvas Scripts, and Gradient Presets. Themes save complete snapshots of all 4 modes, including accent colors, locks, CSS, Canvas scripts, Manual Variable Overrides, Gradient Background, Surfaces and the auth page settings.
.json files and preserved through imports, so a shared theme keeps its name, author and update address..json files from the same modal, or drop them onto the designer, with the same check..json, .css, or .js files anywhere onto the application. The designer routes each file to its gallery: a .js file to Canvas FX, a .css file to the CSS snippets, a .json gradient preset to the Gradient gallery, and a .json theme, bundle or backup to where its contents belong. An entry that isn’t valid, such as a theme without Dark and Light modes or a preset whose code isn’t text, is skipped, the rest of the file still imports, and the summary says how many were skipped as invalid. A preset without a name is named by its place in the file, such as Animation 2, Snippet 3 or Gradient 4.DATA_DIR/theme/users/<user id>/ and read from {ROUTE_BASE}/me/library.json. Use instance theme keeps them; deleting the account removes them.custom.css..css file named after the active theme. Copy sends it to your clipboard.Theme Designer Pro includes a built-in update system that lets you check for newer versions of themes hosted remotely. This requires a Theme Update URL to be set on a saved snapshot.
.json file. This exported file includes all metadata (name, version, author, description, updateUrl) and can be hosted anywhere accessible via HTTP.1.2.0 when saving. An update is only offered when the remote version is higher than the local one, compared number by number. A leading v is ignored, and a pre-release such as 1.2.0-beta.1 counts as older than 1.2.0.dark and a light mode, or the check reports “Invalid theme format”.manifest.json from GitHub, then fetches any other Update URLs in parallel. It opens a results modal only when it finds updates or errors; otherwise a short message says everything is up to date.fetch() to check URLs. The remote server must allow cross-origin requests (Access-Control-Allow-Origin: *). GitHub raw URLs (raw.githubusercontent.com) work out of the box. Custom servers may need CORS headers configured.blob, raw and gist links are rewritten to raw URLs first. A response is dropped once it passes 2 MB, and a host that hasn’t answered within 15 seconds, or stops sending for 15 seconds, is listed under errors while the other themes are still checked.The following variables are dynamically generated and applied to the Open WebUI root.
| Variable Name | Default Tonal Depth |
|---|---|
| --color-gray-50 | 98% Lightness |
| --color-gray-100 | 94% Lightness |
| --color-gray-200 | 92% Lightness |
| --color-gray-300 | 85% Lightness |
| --color-gray-400 | 77% Lightness |
| --color-gray-500 | 69% Lightness |
| --color-gray-600 | 51% Lightness |
| --color-gray-700 | 42% Lightness |
| --color-gray-800 | 32% Lightness |
| --color-gray-850 | 27% Lightness |
| --color-gray-900 | 20% Lightness |
| --color-gray-950 | 16% Lightness |
These are the Dark, Light and Her defaults, at a Lightness slider of 20%. Moving the slider shifts every step by the same amount (step + slider − 20), kept between 0% and 98%. OLED starts at a slider of 0%, so its 900 and 950 steps are 0%, pure black.
Every mode also defines its three accents, for theme CSS: --tdp-accent, --tdp-accent-2 and --tdp-accent-3. Each is the color set under Accent Colors, or the generated oklch(0.74 C H) on Dark and OLED and oklch(0.56 C H) on Light and Her, where H is the hue (then 40° more, and 40° less) and C is four times the palette’s chroma, kept between 0.06 and 0.18, or 0 for a neutral theme or a mode with its palette off.
The Gradient tab provides a dedicated visual gradient builder for applying CSS gradient backgrounds to your Open WebUI instance. The builder generates all the CSS it needs: the structural transparency rules, the sidebar’s backdrop blur, the chat overlay blending, and the colors of Open WebUI’s sidebar and top fades, so you don’t need to write any CSS yourself. Beside Enabled and Animate, the Show on Auth Pages and Only on Auth Pages checkboxes decide whether the gradient also shows on, or only on, the sign-in page.
When the gradient is enabled (with at least 2 color stops), the designer automatically generates a Structural Layer that makes all layout containers transparent so the gradient shows through. It also adds a semi-opaque backdrop-blur rule to the sidebar for readability, and overrides the chat overlay for proper blending.
If your Custom CSS Snippet contains a gradient function and a background property, the builder displays a warning banner, even when the two are in different rules. The builder’s gradient is written with !important, so a Custom CSS gradient overrides it when it also uses !important on the same element, because the Custom CSS Snippet comes after the builder’s output. To use the Gradient Builder alone, remove or disable the conflicting rules in your Custom CSS Snippet. The AI button’s confirmation says so too when a gradient it picked won’t show for this reason.
The builder includes 12 ready-to-use gradient presets. Clicking a preset turns the gradient on and applies its colors, type and direction, sets the intensity to 85% and the animation speed to 8 seconds, and for a mesh preset, places its own points and base color:
| Preset | Type | Colors |
|---|---|---|
| Midnight | Linear 135° | #0f0c29, #302b63, #24243e |
| Emerald | Linear 135° | #0d2818, #04471c, #058c42 |
| Amethyst | Linear 135° | #1a0a2e, #3d1e6d, #6b3fa0 |
| Sapphire | Linear 135° | #041e42, #0c2d5a, #1e40af |
| Aurora | Linear 135° (animated) | #0f0c29, #1b5e20, #1a237e, #6a1b9a |
| Sunset | Linear 180° | #1a0a2e, #b91c1c, #d97706, #f59e0b |
| Ocean | Linear 180° | #001219, #005f73, #0a9396 |
| Neon | Linear 135° | #0d0221, #0d0b52, #6a11cb, #f953c6 |
| Nebula | Mesh | #6366f1, #ec4899, #06b6d4, #8b5cf6 |
| Lagoon | Mesh | #0d9488, #22d3ee, #059669, #0284c7 |
| Ember | Mesh | #dc2626, #ea580c, #d97706, #991b1b |
| Arctic | Mesh | #38bdf8, #22d3ee, #818cf8, #2563eb |
In Open WebUI, each person can set a Chat Background Image in Settings → Interface, and a model or a folder can have a background image of its own, set in the model’s editor or the folder’s Edit Folder dialog. Open WebUI lays the image over the chat with a dimming layer, so it covers this theme’s gradient or Canvas FX. The dimming layer stays while Canvas FX or a gradient runs, so at 100% the image looks as Open WebUI shows it.
The Backgrounds tab lists the Chat Background Image, every model with a background image, and in a personal theme every folder of yours with one. Each row’s Opacity slider sets the opacity of that image and its dimming layer while the theme is in use: at 100% it shows as Open WebUI shows it, at 0% it’s hidden, so the theme’s own background shows in its chats. In between, the theme shows through the image. A folder’s image shows only on that folder’s page, where a new chat in the folder starts, so that is where it fades.
Draw the Canvas FX animation over these images, above the list, decides which is on top. It’s on by default, so picking a Canvas FX script shows the animation over the pictures straight away. Off, the images sit over the theme’s animation and cover more of it the higher their opacity. On, every one of them and its dimming layer moves behind the animation, so the animation stays on top at any opacity. It takes effect only while an animation runs, so it’s grayed out in a mode with no Canvas FX. A gradient can’t have an image behind it: the gradient is the page’s own background, which always sits under everything, so the image stays in front of it either way.
Dimming, under it, sets how much of Open WebUI’s dimming layer covers every one of these images: at 100% it stays as Open WebUI draws it, lower thins it to brighten the pictures, and at 0% they show clear. It combines with each image’s Opacity, so at 50% Opacity and 40% Dimming the image shows at half opacity and its dimming layer at a fifth.
Sign-in page, the last row in the instance designer, gives the sign-in page a picture of its own, which Open WebUI doesn’t offer. Upload picture stores a PNG, JPEG, GIF or WebP of up to 5 MB with the function, which serves it at {ROUTE_BASE}/auth-background to anyone, since nobody is signed in on that page; only an admin can upload or remove it. Use URL takes an https:// address instead. The picture sits under the same dimming layer as Open WebUI’s own background images, so Dimming and Draw the Canvas FX animation over these images apply to it too, and its own Opacity slider fades it into the theme. Only the instance theme can set it, and Enable Auth Page Theming off hides it with the rest of the sign-in theming. Remove, Reset Mode and Global Reset delete an uploaded picture, in Draft mode once you Publish. Uploading needs Live mode, because the upload replaces the published picture at once.
Other pages gives the pages without a chat a picture of their own: Workspace, Notes, Calendar, Automations, Channels, the admin pages and the rest, where Open WebUI draws no background. Use my Chat Background Image (in the instance designer, Use each person’s Chat Background Image) shows the picture each viewer set in Settings > Interface. Upload picture stores a PNG, JPEG, GIF or WebP of up to 5 MB with the function, and Use URL takes an https:// address. The instance theme’s upload is served at {ROUTE_BASE}/page-background to anyone signed in, and only an admin can change it; a personal theme’s is kept in that user’s own folder and served to them alone at {ROUTE_BASE}/me/page-background. The picture sits under the same dimming layer, so Dimming and Draw the Canvas FX animation over these images apply to it, and its Opacity slider fades it into the theme. Those pages’ solid panels clear so the picture shows, as they do under Canvas FX; rounded panels and controls keep their fill. Remove, Reset Mode and Global Reset delete an uploaded one, in Draft mode once you Publish. Uploading needs Live mode, because the upload replaces the published picture at once.
The list belongs to the live theme, not to a gallery theme: applying another theme leaves it as it is, and exported theme files don’t carry it. Reset Mode and Global Reset put every setting in the tab back to its default, in every mode, since the tab has one set of settings for all of them. The instance theme sets models’ images, and each person’s own Chat Background Image, for everyone using it. Folders belong to each person, so only a personal theme sets theirs. A Chat Background Image changed in Settings, or a model’s changed in its editor, fades at once, with no page load. A tab still showing the old image keeps it faded until it reloads.
Advanced: For more complex gradient setups beyond what the builder offers, you can also write gradient CSS manually in the Style Overrides tab using Custom CSS. Because Custom CSS comes after the builder’s output, a Custom CSS background-image with !important on the same element replaces the builder’s gradient rather than layering with it.
When you enable a Canvas FX animation or a Gradient Background, the designer automatically generates a set of CSS rules called the Structural Layer. This layer makes the native Open WebUI UI panels transparent so the background effect shines through, while intelligently preserving opaque backgrounds on overlay UI elements (dropdown menus, modals, dialogs) for text readability.
When Canvas FX and/or Gradient Background are active, the final visual output is composed of 7 distinct layers stacked using CSS z-index and position: fixed:
| Layer | z-index | What It Does |
|---|---|---|
| 1. Body Background | none | The body element's background-color (your OKLCH palette's base gray) and, if gradient is active, the background-image gradient. |
| 2. Background Color Div | -2 | A full-viewport <div id="owui-theme-bg-color"> inserted behind everything. It’s created only while Canvas FX runs, and the structural layer makes it transparent so the canvas shows through. |
| 3. Pictures | -1 | The Backgrounds tab’s Other pages picture, on a fixed layer behind the app, and Open WebUI’s own background images with their dimming layer, which move under the canvas while Draw the Canvas FX animation over these images is on. |
| 4. Canvas Element | 0 | A full-viewport <canvas id="owui-theme-canvas-bg"> where your Canvas FX animation renders. Has pointer-events: none so it never intercepts clicks. |
| 5. Structural Transparency | none | CSS rules that set background-color: transparent on .app, .app > div, main, nav, sticky bars, the designer’s and the sign-in page’s containers, wrappers painted with a gradient class (apart from the sidebar fades, the top fade and the chat background’s dimming layer), and layout wrappers whose classes begin with bg-gray-, bg-base-, dark:bg-gray- or dark:bg-base- (not hover or other variants). Interactive elements (button, a, input, select, label, span), your own message bubble, rounded controls such as the message input and pill buttons, everything inside the message input, and the login card are excluded, so they keep Open WebUI’s own look. The rules use !important and are scoped to the mode’s selector plus .app, so overriding one takes !important and at least that specificity. See Overlay UI Protection below for how portaled overlay UI stays opaque. |
| 6. Glass Panels | none | A semi-opaque overlay with backdrop-filter: blur() on the sidebar, keeping navigation readable while letting the background show through. The Gradient Builder auto-calculates the RGBA value from the darkest gradient stop (or the mesh background color for Mesh gradients). The sidebar’s glass behavior is controlled by the Sidebar Transparency valve: opaque (default) uses a solid background, except that with a gradient active the sidebar takes the darkest gradient color at 75% opacity with a 12px blur, translucent applies a tinted glass effect with backdrop-filter: blur(20px) saturate(1.3), and transparent removes the background entirely (auto-upgraded to translucent on mobile for readability). Open WebUI’s fades at the top and bottom of the sidebar follow the same valve: they stay while it’s opaque, in the gradient’s sidebar color while a gradient is active, and go away with translucent or transparent, where they would read as solid bands. Both sidebar and overlay transparency valves work independently of Canvas FX and gradient state. In a mode with its Surfaces switch on, the Surfaces rows set the sidebar and overlays instead of these valves. |
| 7. Overlay Glass | none | Portaled UI elements (settings modal, dropdown menus, user menus, integration menus) that live outside .app on <body>. Controlled by the Overlay Transparency valve: opaque (default) keeps solid backgrounds for readability, translucent applies frosted glass with backdrop-filter: blur(20px) saturate(1.3). Uses CSS :not(.app *) exclusions to avoid affecting elements inside the main app container. translucent also hides the fade at the top of chats. |
Dropdown menus, modal dialogs, and listbox selectors are portaled outside the .app wrapper: they are appended directly to <body>. To ensure these remain readable against canvas/gradient backgrounds, the structural layer uses a multi-pronged strategy:
bg-gray- and bg-base- transparency rule is wrapped in CSS :where(), so it adds nothing to the specificity beyond the mode selector and .app. Its declarations are !important, though, so only an !important rule of equal or higher specificity overrides them.button, a, input, select, label, and span are excluded from transparency entirely via :not() filters, and so is anything with a rounded class, the message input and everything inside it. This protects toggle knobs (bg-white circles), styled buttons, the message input’s own tint and other small UI widgets: they hide almost none of the background, so clearing them only changed their look. Dropdown menus, modal dialogs, and listbox selectors, which are portaled outside the .app wrapper, are naturally unaffected because the transparency rules only target elements within .app, #theme-designer-container, and #auth-page scope.bg-gray-* and bg-base-* elements inside #sidebar become transparent like the rest of the app, but stay readable because the sidebar itself keeps its own background: --color-gray-950 in Dark and OLED, --color-gray-50 in Light and Her, or the darkest gradient color at 75% opacity with a blur while a gradient is active. The Sidebar Transparency valve controls that backdrop: opaque (the default) keeps it as described, while translucent and transparent swap it for a frosted-glass or fully see-through backdrop so Canvas FX and gradient backgrounds show through.translucent, the system appends CSS rules targeting div[class*="bg-gray-"], div[class*="bg-base-"] and div[class*="bg-white"] elements inside portals using color-mix() and backdrop-filter. Elements inside .app and #theme-designer-container are explicitly excluded via :not(.app *) to prevent regressions in the main UI. When the designer is open in the Themes tab of Settings, its own page turns clear too, so the glass shows behind it, as long as the designer’s light or dark look matches Open WebUI’s. Editing the other mode keeps the page solid so its text stays readable.Note: The [class*="bg-white"] attribute selector is intentionally not included in the structural transparency rules. Elements with bg-white classes in Open WebUI are almost always interactive widgets (toggle indicators, button styling, card backgrounds), not structural layout wrappers. However, it is included in the overlay translucency rules since overlay panels in light mode use bg-white as their primary background class.
The structural transparency rules are only emitted when at least one of the following is true for the active mode:
If neither is active, the structural rules are just opaque background-color rules for body and #sidebar, and textareas keep Open WebUI's native styling (recolored by the palette variables) so intentionally transparent fields are left alone. The Surfaces tab and an Other pages picture can still make layers see-through without either.
The see-through rules apply only where their background shows. On a sign-in page with the background's Show on Auth Pages off, and on the other pages with its Only on Auth Pages on, Open WebUI's panels keep their fill. With the Enable Canvas FX valve off, so do the panels of a mode whose only background is Canvas FX; a gradient beside it keeps them see-through. The Surfaces rules stay either way.
background-color on .app, main, or other layout containers, it can override the structural transparency and block the background effect from showing through. To fix this, set those backgrounds to transparent in your Custom CSS..app to something else), the structural layer selectors may stop matching. This can cause panels to revert to opaque backgrounds, hiding the canvas or gradient behind them.body (layer 1), while the canvas renders at z-index 0 (layer 4). The canvas has a transparent background by default, so the gradient may partially show through depending on what your canvas script draws..app using bg-gray-* or bg-base-* classes will be made transparent, unless they are a button, a, input, select, label or span, have a rounded class, or sit inside the message input or your own message bubble. If a third-party extension injects custom UI with gray backgrounds, it may become transparent. Use the Style Overrides tab to restore specific elements if needed.The Surfaces tab sets, per mode, how see-through each layer over the background is. Opacity is how much of the color Open WebUI paints that layer covers it, from 0% (clear) to 100% (solid). Blur softens whatever shows through it, up to 40px. For the backdrop behind a dialog, the first slider is how dark it gets. Double-click a slider’s label to reset it to its default.
#message-input-container#controls-container). From 768px each tab, alone or in a split view, looks like the page or chat it shows: a new chat, Files, a file, a terminal, Notes, the calendar or workspaceWith the tab's switch off, a mode follows the Sidebar Transparency and Overlay Transparency valves. On, the mode's own values win over both. Turning it on the first time starts from what those valves draw. Surfaces travel with the theme: they export, sync between modes under their own Sync category, and Reset Mode clears them.
Understanding the injection order helps debug cascade conflicts. The final CSS is assembled in this order:
--color-gray-* palette ramps and --tdp-accent* accents per modebody/#sidebar backdrops; otherwise just opaque body/#sidebar rules. The Surfaces rules follow them when the mode’s Surfaces switch is on.background-image, sidebar blur, and chat overlay rulestranslucent or transparent) and the mobile fix (transparent only). Overlay Transparency translucent appends the overlay glass and hides the top fade. All of these come after Custom CSS.A later rule wins a tie of equal specificity and importance. Many of the designer’s own rules use !important, so a Custom CSS rule needs !important too to override them, as with a gradient background-image over the Gradient Builder’s.
Structured sections: Internally the CSS is generated as four separate sections: vars (palette + manual overrides), structural, gradient, and custom. They are saved to the server both as the flat blob above (served at /theme.css and shown by the header’s CSS button) and as a sections JSON file. Consumers assemble only the sections they need: the bootloader picks sections per the "Show on Auth Pages" toggles (delivered inside state.json under the _cssSections key, plus an extra section holding valve-appended rules that are never auth-gated), and the server composes only vars + custom into /static/custom.css as the flash-free safe subset, plus the overlay glass rules when Overlay Transparency is translucent. The /*[OWUI_*]*/ marker comments still appear in the flat output and remain the fallback slicing mechanism for themes saved by older versions.
A consolidated reference of all keyboard shortcuts available throughout the designer.
| Shortcut | Action |
|---|---|
| Ctrl+Z | Undo last change (Cmd on macOS; not while typing in a field) |
| Ctrl+Y / Ctrl+Shift+Z | Redo last undone change |
| Ctrl+V (image) | Extract palette colors from a clipboard image (not while typing in a field) |
| Ctrl+V (JSON) | Import a theme, or a Canvas FX, CSS or gradient preset backup, from clipboard JSON (not while typing in a field) |
| Escape | Close an open dialog or search bar |
| Enter | Confirm the primary action in a dialog, when the focus isn’t in a text field or on a button; in an Import dialog’s URL field, Enter loads the URL |
| Backspace | Cancel most confirmation dialogs, when you aren’t typing in a field |
| Ctrl+Enter | Create the theme in the AI Consultant form (Cmd+Enter on macOS) |
| Arrow keys, Home, End | With a tab focused: open the next or previous tab, or the first or last |
| Tab | In a gallery, reaches each card (Enter or Space applies it, as a click does) and then the card’s own buttons (Edit, Overwrite, Delete, Export); a card’s buttons show while one of them has keyboard focus. A toolbar’s search box is in the Tab order only while it is open, and a button’s tooltip shows while it has keyboard focus |
| Arrow keys, Home | Move the radial gradient’s center (Shift for bigger steps); Home recenters it |
| Arrow keys, Delete, Tab | With the mesh pad focused: move the selected point (Shift for 5 steps), remove it with Delete or Backspace (a mesh keeps 2 points), or switch points with Tab and Shift+Tab, which leave the pad after the last point or before the first |
| Double-click slider label | Reset the Hue, Chroma, Lightness, Gradient Direction, Color Intensity, Animation Speed or a Surfaces slider to its default; on the Accent Colors label, set all three accents back to automatic |
| Double-click on a gradient pad | On the radial pad, recenter it; on a mesh point, remove it |
| Escape | Close the Documentation panel |
These apply inside the Custom CSS, Canvas FX, and Manual Overrides editors:
| Key | Behavior |
|---|---|
| Tab | Inserts a 2-space indent while tab trap is active (default on). Press Escape to toggle. |
| Enter | Auto-indents the new line to match the previous line's indentation |
| { | Auto-inserts closing }, and the same for (, [, ", and ' |
| Enter after { | Indents the new line by two more spaces; if no } follows the cursor, also adds a closing } on its own line below |
| Escape | Toggles tab trap mode; when off, Tab moves focus instead of inserting spaces |
Import any preset directly into Theme Designer Pro using the built-in Import button, URL import, or drag-and-drop.
The Themes area includes a curated Community Themes grid, fetched from the presets repository’s docs/catalog.json on GitHub. Each card shows the theme’s preview colors and metadata with a one-click Install button, which adds the theme to your Theme Gallery; installed themes are marked. When Enable Theme Update Checks is on, the grid also reads manifest.json and a card offers an update if the remote version is newer than your installed copy. An Install All button appears when at least one theme isn’t installed, alongside Refresh, search (name, description, author) and a sort that cycles A to Z, Z to A and the catalog’s order. The Enable Community Themes valve hides the whole browser and skips its catalog fetch. If you set Allowed Import Domains, include raw.githubusercontent.com, or the grid shows “Could not load community themes.”
Every preset in the preset gallery, and every theme made in its Studio, has an Install on my Open WebUI button. After a visitor tells the site their Open WebUI address once, the button opens this designer with an address ending in #tdp-import=. A preset opens its own Import dialog with its address filled in, and you choose Load URL, so Enable URL Import and Allowed Import Domains apply as they do to an address typed in by hand. A Studio theme travels inside the link and is offered the way a pasted theme is, with the Canvas FX warning when it has a script. Anyone can write such a link, a chat model included, so what it brings, in the link or from the address it fills in, gets the check a chat theme gets: custom CSS, Manual Overrides or a CSS snippet that fetches is refused with a message saying why. Nothing installs until you confirm, the link leaves the address bar once read, and a preset type whose valve is off is refused.
Open the Import modal in the Themes tab, paste this URL, and click Load URL; all Canvas FX animations, themes and gradients are imported in one shot. The Import modals in the Style Overrides, Canvas FX and Gradient tabs take only their own type.
https://raw.githubusercontent.com/silentoplayz/theme-designer-pro-presets/main/bundles/everything.json
Prefer to import only specific types? Use these individual bundle URLs:
https://raw.githubusercontent.com/silentoplayz/theme-designer-pro-presets/main/bundles/themes-all.json
https://raw.githubusercontent.com/silentoplayz/theme-designer-pro-presets/main/bundles/canvas-fx-all.json
https://raw.githubusercontent.com/silentoplayz/theme-designer-pro-presets/main/bundles/gradients-all.json
If Open WebUI is behind a reverse proxy (nginx, Caddy, Apache, Traefik, etc.), the live updates at {ROUTE_BASE}/events need to stream through it. The function sends X-Accel-Buffering: no with them, so stock nginx streams them even with buffering on. Turn buffering off anyway if your proxy or CDN ignores that header, or if proxy_ignore_headers removes it: otherwise open pages only see a theme change after a reload. The theme itself, theme.css and state.json, loads fine either way.
Two more settings matter. Picture uploads are up to 5 MB and theme saves up to 64 MB, so raise nginx’s client_max_body_size (1 MB by default), for example to 64m, or larger saves fail with 413. A proxy that only passes certain paths must pass everything under {ROUTE_BASE} (the designer, saves, /events, /events/bind, /theme.css, /state.json, /library.json, /consult, /me and its routes, /auth-background and /page-background) plus /static/loader.js and /static/custom.css.
The proxy must also forward the host the browser asked for. Saves, picture uploads, /consult and /events/bind refuse a request sent by a page on another origin. Over plain HTTP, browsers don’t say where a request came from, so the check compares the page’s host with the Host header the proxy forwards (the port may differ). Keep proxy_set_header Host $host; as below, since nginx otherwise forwards its upstream’s address, or set Open WebUI’s WEBUI_URL to the address people open. Without either, those requests answer 403 “Changes must come from Open WebUI’s own pages”.
Theme Designer Pro uses three delivery layers to push themes to every page (the instance theme to everyone without a personal theme, a personal theme to its owner’s pages):
{ROUTE_BASE}/events{ROUTE_BASE}/theme.css and {ROUTE_BASE}/state.json on every page loadReverse proxies that buffer responses (the default for nginx) can hold SSE events in memory instead of passing them on. Other users and devices then see a theme change only after they reload the page.
Add proxy_buffering off; to your Open WebUI location block:
location / {
proxy_pass http://127.0.0.1:8080;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
# REQUIRED for SSE streaming (theme live push, chat streaming)
proxy_buffering off;
}
Then run: sudo nginx -t && sudo systemctl reload nginx
Caddy disables response buffering by default, so it needs no extra configuration. If you have explicitly enabled buffering, disable it:
your-domain.com {
reverse_proxy localhost:8080 {
flush_interval -1
}
}
Disable output buffering for the Open WebUI proxy:
# flushpackets=on passes each SSE event on as it arrives
ProxyPass / http://127.0.0.1:8080/ flushpackets=on
ProxyPassReverse / http://127.0.0.1:8080/
Ensure response buffering middleware is not applied to the Open WebUI service. Traefik streams by default, but if you've added a buffering middleware, remove it for the Open WebUI router.
If themes aren't propagating to other users/devices:
https://your-instance{ROUTE_BASE}/theme.css. If it returns CSS content, the server is working and the issue is in the delivery layer (proxy buffering or missing bootloader)./static/loader.js directly and search for owui-theme-designer-pro:start. If it’s missing, this worker has not published its fragment yet (send a chat message to trigger event()).{ROUTE_BASE}/events stays open (pending). If it fails or closes right away, your proxy is likely buffering or blocking SSE.If you run Open WebUI with multiple Uvicorn workers (UVICORN_WORKERS > 1), be aware of this SSE limitation:
{ROUTE_BASE}/theme.css and {ROUTE_BASE}/state.json from disk on every page load, which works correctly across all workers. Themes propagate on the next page load/refresh.REDIS_URL is set in your environment (which Open WebUI already uses for WebSocket relay), Theme Designer Pro automatically uses Redis pub/sub to broadcast SSE events across all workers. No additional configuration is needed beyond setting REDIS_URL. The value must be the URL itself. In a Docker Compose environment: list, write - REDIS_URL=redis://redis:6379/0 without quotes, because quotes there become part of the value. The mapping form, REDIS_URL: "redis://redis:6379/0", works too, because YAML removes those quotes. When REDIS_URL doesn’t start with redis://, rediss:// or unix://, Theme Designer Pro logs one warning saying so and keeps live push within each worker. A quoted WEBSOCKET_MANAGER="redis" turns off Open WebUI’s own Redis relay the same way.{REDIS_KEY_PREFIX}:theme_pro_sse, and code and on/off changes on {REDIS_KEY_PREFIX}:live-reload:function_<function id>, for example open-webui:live-reload:function_theme_designer_pro. Redis channels ignore the database number, so two Open WebUI instances on one Redis server need different REDIS_KEY_PREFIX values to stay apart. Both use Open WebUI’s own Redis connection, so they work wherever Open WebUI’s Redis does, Redis Sentinel (REDIS_SENTINEL_HOSTS) and Redis Cluster (REDIS_CLUSTER) included. Without Redis, a personal theme’s live updates can miss a page whose live connection and sign-in claim land on different workers; that page still gets the theme on its next load./static/loader.js and /static/custom.css from what it has loaded, so a worker only serves the theme once it has run this function at least once. Open WebUI publishes system.startup.completed in every worker's lifespan, so in practice all of them publish during boot.TL;DR: Single-worker deployments (the default) work perfectly. Multi-worker deployments get live push across workers automatically if REDIS_URL is set; otherwise, themes propagate on page refresh.
loader.js and custom.css With Other Plugins Open WebUI loads exactly two admin-extensible assets on every page: /static/loader.js (the only hook that runs before the SvelteKit bundle hydrates) and /static/custom.css (a render-blocking stylesheet). Any plugin that wants to reach the page before it paints needs one of them, and neither can have a single owner.
Since version 1.7.0, Theme Designer Pro no longer writes into index.html. It publishes a fragment into a shared registry on app.state, and a route composes every registered plugin's fragment into the response per request. What follows from this:
static/custom.css or static/loader.js, it is served first, followed by each plugin's fragment. The file on disk is never changed: when it’s served, any block wrapped in a registered plugin’s markers is left out and the rest is served as written. A symlinked file is ignored rather than served.(order, key) order, and this plugin registers at order=100 so its custom CSS keeps the last word, as documented in Section 18. A plugin at a lower order composes earlier and loses ties at equal specificity.Upgrading from 1.6.2 or earlier removes the old index.html blocks automatically on the first event. See Section 25 if you want to verify by hand.
Common issues and their solutions.
index.html injection left by versions up to 1.6.2, which logs a warning and moves on if the file is not writable.OffscreenCanvas (indicated by the green Background Worker badge in the designer UI). Note: the badge is a pre-launch prediction (browser capability plus a static scan of the script source), so a script that only fails at runtime still falls back to the main thread without the badge changing. If your script runs on the main thread, keep animations simple. Even with Web Workers, massive particle counts or heavy calculations can still consume significant CPU/GPU resources.{ROUTE_BASE}/theme.css. If the theme files are missing from DATA_DIR/theme/, the bootloader has nothing to serve. Verify the endpoint works by navigating directly to {ROUTE_BASE}/theme.css in your browser; it should return CSS content. A user with a personal theme sees theirs instead of the instance theme: Use instance theme in their Themes tab puts them back, and turning Allow Personal Themes off puts everyone back without deleting anything.X-Accel-Buffering: no, which nginx honors unless proxy_ignore_headers removes it; proxy_buffering off also covers proxies and CDNs that ignore the header. Quick diagnostic: open DevTools → Network tab on the non-working device and check that the request to {ROUTE_BASE}/events stays open (pending).function.disable_started lifecycle event, which broadcasts a theme-disable SSE event to strip the theme from all clients. The CSS fragment is withdrawn from /static/custom.css at the same time, while the loader fragment stays published in an inactive state so its SSE connection survives. When re-enabled, the function.enable_started event republishes everything automatically. While the function is off, the designer, saves, the library, the AI Consultant and picture uploads answer 503 “Theme Designer Pro is currently disabled”, while theme.css and state.json answer empty and the live connection stays open.theme-disable SSE event removes 7 injected DOM elements by ID: owui-dev-live-theme (main CSS), owui-server-theme (server-injected CSS), owui-theme-style (legacy), owui-theme-canvas-bg (canvas), owui-theme-bg-color (background div), owui-canvas-script-runner (canvas script), and owui-tdp-hidden-bg (the Backgrounds tab’s rules). It also clears the in-memory theme state, the localStorage cache, and this browser’s copy of a personal theme, then reloads /static/custom.css so the palette drops out. A Global Reset sends the same event marked as a reset, and pages then fetch whatever theme is left (a personal theme, or none) over the usual two-second spread instead of stripping it.app.state and survive function hot-reloads. If you do experience this, check that the SSE endpoint is reachable at {ROUTE_BASE}/events. The server sends a heartbeat every 15 seconds. After a dropped connection, the page reconnects in about 3 seconds; after an HTTP error, such as a proxy’s 502, it waits longer each time, up to about 90 seconds.sessionStorage (tab-scoped), syncToServer() is gated off, and mode changes (Dark/Light/System/etc.) apply only to the designer page’s <html> element, so other tabs and the admin’s live session aren’t affected. Gallery and preset changes still sync to the server library.function_<id>_<32 hex characters>. Versions of Theme Designer Pro before 1.9.1 read their ID from that name, so they never recognized their own disable event; update to the current version./api/v1/ to prevent the SPA catch-all from intercepting the route. A warning is logged when auto-correction occurs. Check your Open WebUI logs for [Theme Pro] messages.Toggling the function OFF in the admin panel automatically withdraws the theme CSS from /static/custom.css, marks the bootloader inactive, and broadcasts a cleanup event to all connected clients. In most cases, no manual removal is needed. However, if the cleanup didn't complete (e.g., the server crashed mid-toggle), follow these steps for a complete manual removal:
With the function on, the Factory Reset button in the Danger Zone section below wipes the instance theme, the library and this browser’s main keys. To remove every key, personal and Launcher ones included, or once the function is off, open your Open WebUI instance, press F12 to open Developer Tools, go to the Console tab, and paste:
['owui_dev_theme_v1', 'owui_dev_theme_v1_css',
'owui_theme_snapshots',
'owui_canvas_presets', 'owui_css_presets', 'owui_gradient_presets',
'owui_canvas_last_mode', 'owui_canvas_last_script',
'owui_theme_last_metadata', 'owui_theme_valve_no_canvas', 'ignored_updates',
// the model and chat background addresses the theme looked up
'owui_tdp_model_bg', 'owui_tdp_chat_bg',
// personal themes, and the legacy Tool's theme kept aside
'owui_tdp_personal_css', 'owui_tdp_personal_state', 'owui_tdp_personal_uid',
'owui_tdp_seen', 'owui_tdp_tool_state', 'owui_tdp_tool_css', 'owui_tdp_tool_dismissed',
// the personal designer's own copies
'owui_tdp_me_theme_v1', 'owui_tdp_me_theme_v1_css', 'owui_tdp_me_snapshots',
'owui_tdp_me_canvas_presets', 'owui_tdp_me_css_presets', 'owui_tdp_me_gradient_presets',
'owui_tdp_me_last_metadata', 'owui_tdp_me_canvas_last_mode', 'owui_tdp_me_canvas_last_script'
].forEach(k => {
localStorage.removeItem(k); console.log('Purged: ' + k);
});
// this tab's drafts, open tab and Launcher bookkeeping
Object.keys(sessionStorage).filter(k => k.startsWith('owui_')).forEach(k => sessionStorage.removeItem(k));
location.reload();
Delete the whole DATA_DIR/theme/ folder from the server’s data directory. It holds:
open_theme_designer.css, open_theme_designer.json, open_theme_designer_sections.json and open_theme_designer_library.json: the instance theme and libraryauth_background and page_background: the uploaded sign-in page and Other pages picturesusers/: one folder per account with a personal theme, library or Other pages picture, named by the user’s id.save.lock: the lock that keeps two workers from saving at once.index.lock: the lock for the check, run once per start, that removes index.html blocks left by 1.6.2 or earlierindex.html. Since 1.7.0, a check run once each time Open WebUI starts removes those blocks automatically. To check by hand, look in the frontend build’s index.html (/app/build/index.html in Docker) for <!-- OWUI Theme Pro Bootloader -->, <style id="owui-server-theme"> and <script type="application/json" id="owui-theme-state">; all three should be gone.In the Open WebUI admin panel, navigate to Functions and turn the Theme Designer Pro event function off first, then delete it. Turning it off strips the theme from every page and withdraws its CSS, but its bootloader stays in /static/loader.js, inactive, with its live connection. A function deleted while on keeps serving its whole theme, bootloader and CSS alike. Either way that lasts until the server restarts (Step 3), because Open WebUI tells a function nothing about its own deletion, unless another installed plugin that shares the registry handles the deletion: it removes the fragments on the worker that handles it and turns them off on the others. If you installed the Theme Designer Pro Launcher, delete it from Workspace > Tools too. The function keeps nothing in Open WebUI’s database besides its own row in the function list, which deleting it removes.
Export your theme gallery snapshots, custom CSS presets, canvas animation scripts, and gradient presets to separate portable backup files at once, and restore them anytime with the import features in their tabs. The live theme is included only if you’ve saved it as a snapshot, and valves aren’t included. In a personal Themes tab, this exports your own library. For a full server backup, copy the DATA_DIR/theme/ folder, including users/; it’s also the only backup of uploaded pictures, which exports don’t carry. Each backup file wraps its items in one key: themes, css_presets, canvas_presets or gradient_presets, and the theme format is described in the presets repository’s schemas/theme-format.md. An imported file or bundle can be up to 16 MB, and a save to the server up to 64 MB, with the theme’s CSS, its state and its sections up to 5 MB each.
Theme Designer Pro is an event function provided for educational and customization purposes. By using this function, you acknowledge and agree to the following:
This function is provided "as is" without warranty of any kind. By using Theme Designer Pro, you acknowledge that serving instance-wide CSS and JavaScript may have security implications. Use only on trusted instances.
Permanently wipe all Theme Designer Pro data including your theme gallery, CSS snippets, canvas scripts, gradient presets, and active configuration. This action cannot be undone. In a personal Themes tab, it removes your personal theme and your library.