Skip to main content
Themes give you control over the visual identity of every deck in your workspace. A theme is a :root block of --slide-* CSS variables that the Ablo renderer reads to paint colors, choose fonts, and scale typography. You can author a theme as a structured spec — a colors + fonts object — and the SDK compiles it to the canonical CSS that byte-matches a theme created in the editor. You can also pass raw CSS directly when you need precise control. Once created, a theme can be set as the workspace default or atomically applied to a specific deck in a single API call.

Creating a theme

Call ablo.themes.create() with a name and either a structured spec (colors + fonts) or a raw css string. The method returns the saved theme object, including its id.
string
required
A human-readable label shown in the Ablo editor’s theme picker.
ThemeColors
The seven color slots that define the palette. All values are CSS color strings.
ThemeFonts
{ heading, body } — font family names. Use values from FONT_FAMILIES exported by @abloatai/decks to stay within the supported set.
boolean
When true, this theme becomes the workspace default applied to all new decks.
string
A deck id. When provided, the theme is applied to that deck atomically as part of the create call — no separate update step needed.

Color slots

The colors object has exactly seven required keys. Every key maps directly to a --slide-* CSS variable the renderer reads.

brand

Primary accent color. Used for CTAs, highlights, and interactive elements. Maps to --slide-brand.

brandLight

Lighter tint of the brand color. Used for backgrounds behind brand-colored elements. Maps to --slide-brand-light.

textColor

Main body text color. Maps to --slide-text-color.

textMuted

Secondary/muted text. Used for captions, labels, and supporting copy. Maps to --slide-text-muted.

surface

Slide canvas background color. Maps to --slide-surface.

card

Card and panel background. Maps to --slide-card.

border

Border and divider color. Maps to --slide-border.

Raw CSS themes

When you need control beyond the structured spec — custom typography overrides, additional variables, or a pre-existing CSS block — pass a css string directly instead of colors and fonts. The string must be a valid :root { --slide-* } block.

Inspecting compiled CSS

You can call buildThemeCss() to preview the CSS the SDK produces from a structured spec before sending it to the API. This is useful for debugging, seeding scripts, or understanding exactly what variables a structured theme sets.

Using theme color tokens in layers

Rather than hard-coding 'var(--slide-brand)' throughout your layer definitions, use colorRef() to resolve a token name to the correct CSS variable reference. The compiler validates the token name and your editor will autocomplete the available options.
The available color tokens and their CSS variables are:

Theme CSS variables reference

A structured theme compiles to a full :root block covering fonts, a complete typography scale, and all seven color slots. Here is the complete variable set the renderer reads.

Updating and deleting themes

Use ablo.themes.update() to rename a theme or replace its CSS. Use ablo.themes.delete() to remove a theme permanently.
1

Update a theme

Pass the theme id and any fields you want to change. Unspecified fields are left untouched.
2

Delete a theme

Deleting a theme does not affect decks that already have the theme’s CSS applied — those variables are stored on the deck itself and continue to render correctly.
Font family names must come from the FONT_FAMILIES list exported by @abloatai/decks. Passing an unsupported font name will cause the renderer to fall back to the system font. Use import { FONT_FAMILIES } from '@abloatai/decks' to enumerate valid options.