DASH:Gen

Docs

Apache Superset themes — the fourth template library

The sibling of Handlebars chart templates and Power BI templates for the CSS themes an Apache Superset or HTML dashboard is painted with. Until 2026-09-11 these were seeded files and nothing else; they are now a library users write to, on the same contract as the other three.

Apache Superset theme
What it isA CSS body plus a chart colour scheme, applied to the whole dashboard — and, when it has colour tokens, the palette a design draws with on every target
Where it goesApache Superset v6: the dashboard's css and metadata.color_scheme. The HTML exporter styles its own page from the same row; with a design, HTML, Superset and Power BI all read its tokens (HTML dashboard §5a)
Built-insThe 40 themes seeded from *, plus 14 palettes without a stylesheet (raster-*)
Who can add oneEveryone, in Libraries → Colours
Who can edit itIts author. A built-in answers 409 "copy it instead"
Who can use itEveryone, once it is Public; its author alone while it is Private
Limit10 per user

Authoring a theme is free: it runs no AI and consumes no coins.

1. Private or Public

A theme you create starts Private — creating is not publishing. Nobody else lists it, gets it by name, or can start a run with it. Publish it and everyone can; it stays yours to change or delete, and a colleague's PUT still answers 404.

Two consequences worth knowing:

2. Writing one

Libraries → Colours → New theme. The editor gives you a starter skeleton over the handful of Apache Superset selectors every shipped theme paints, and a live preview beside it.

What the CSS may not contain

Both rules are enforced by StyleContentRules, on the seeder and on the write API alike, so a classpath file refused at boot and a body refused at save time are refused in the same words.

Plus the sizes: 32 768 characters of CSS, 96 for the name, 255 for the description and keywords, 1000 for the when-to-use text.

3. Copying

Copy is on every row, built-ins included, and is the answer to "I want to tweak one of the 40". It pre-fills the editor with the body and fields, clears the identity, and saves as a new theme of yours — always Private to begin with.

4. Shipping one with the platform

Drop a .css file in <name> and give it an entry in DashboardStyleSeeder's CATALOG (description and colour scheme). The seeder upserts on the next boot, keyed by file name, never touches the enabled flag, and stamps PUBLIC every time — a shipped theme is everyone's, and an operator's stray UPDATE must not be able to hide one.

It also needs <name> beside it: the fifteen colours above, read off the CSS body (the PALETTE (reference) comment is a hint, the selectors are the truth). A shipped theme without a tokens file fails the engine's startup naming the theme — a catalogue in which some themes combine with a design and some silently do not is worse than none. The 40 files were authored under one rule: bg/text from .dashboard, surface and border from the chart holder, surface2 from the chart header, textMuted from th, accent from the input's hover border and accentDeep from its focus border, onAccent from the primary button, selected from the row hover, borderStrong as border mixed 35 % toward text, positive/negative as #2A9D5C/#D64545 (lightened on a dark theme), the notice as surface tinted 18 % toward accent.

The palettes without a stylesheet ship the same way, minus the CSS: a tokens file raster-<name> with all fifteen colours, neutral and the eight series, and an entry in DashboardStyleSeeder's PALETTES (display name, description, colour scheme). Their names are raster-* without the number, so they never collide with the Power BI Dashboard-Templates raster-NN-*.

A seeded theme carries no display name: the browser labels it from its file name, as it always has. Only user themes need one.

5. REST

GET    /api/v1/dashboards/styles           the library (no css bodies)
GET    /api/v1/dashboards/styles/{name}    one theme incl. css (ETag/304)
POST   /api/v1/dashboards/styles           create — you become its author
PUT    /api/v1/dashboards/styles/{name}    update your own
DELETE /api/v1/dashboards/styles/{name}    delete your own

Studio proxies all five unmetered and stamps the author name from the token. On the engine, X-User-Id is optional on reads — a call without it sees the built-ins and every published theme, and nothing is editable — and required on writes, which answer 400 without it.

Without an account, two reads are open on the guest prefix: GET /api/v1/guest/dashboards/styles (the list) and GET /api/v1/guest/dashboards/styles/{name} (one theme with its CSS, for the preview). Both send no identity, so they see only the built-ins and published themes — the same CSS a guest's dashboard carries once that theme is chosen. A private theme answers 404 there.

Somebody else's theme answers 404, never 403: a name must not confirm to a non-author that it exists. A built-in answers 409 template-not-editable.