: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
Callablo.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.
A human-readable label shown in the Ablo editor’s theme picker.
The seven color slots that define the palette. All values are CSS color strings.
{ heading, body } — font family names. Use values from FONT_FAMILIES exported by @abloatai/decks to stay within the supported set.When
true, this theme becomes the workspace default applied to all new decks.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
Thecolors 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 acss string directly instead of colors and fonts. The string must be a valid :root { --slide-* } block.
Inspecting compiled CSS
You can callbuildThemeCss() 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.
| Token | CSS Variable |
|---|---|
'brand' | --slide-brand |
'brandLight' | --slide-brand-light |
'text' | --slide-text-color |
'textMuted' | --slide-text-muted |
'surface' | --slide-surface |
'card' | --slide-card |
'border' | --slide-border |
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.
- Fonts
- Typography scale
- Colors
| Variable | Description |
|---|---|
--slide-font-heading | Font family for heading styles (title, h1–h3) |
--slide-font-body | Font family for body, body2, small, and caption styles |
Updating and deleting themes
Useablo.themes.update() to rename a theme or replace its CSS. Use ablo.themes.delete() to remove a theme permanently.