Skip to content

Themes

A theme is a design system for decks. Choosing one is a single line in the frontmatter:

theme: nyx

or at build time: peitho build slides.md --theme fresco. Compare them with peitho themes preview slides.md.

Built-in themes

Theme For Style
agora business, clients, committees light, sober sans-serif, one accent color, white space
nyx tech talks, conferences, demos dark, monospace titles, bright accent, Dracula code colors
fresco keynotes, storytelling, workshops warm palette, serif italic titles, big images and numbers

Small changes: brand

brand:
  primary: "#E4002B"
  accent: "#1D428A"
  font: Inter          # must be installed, or provided by your theme
  logo: ./logo.svg

Your own theme

A theme is a folder:

my-theme/
  theme.yaml     # name, description, extends, codeStyle
  tokens.json    # design tokens (W3C Design Tokens format)
  theme.css      # how the shared layouts look

theme.yaml:

name: my-theme
description: Our company look
extends: agora        # optional: inherit tokens and CSS, then override
codeStyle: github     # any Chroma style: https://xyproto.github.io/splash/docs/

tokens.json uses the W3C Design Tokens format. Every token becomes a CSS custom property --pt-<group>-<name>; references such as "{color.primary}" become var(--pt-color-primary).

{
  "color": {
    "primary": { "$value": "#E4002B" },
    "heading": { "$value": "{color.primary}" }
  },
  "font": {
    "heading": { "$value": ["Montserrat", "Arial", "sans-serif"] }
  }
}

Tokens every theme provides (inherit them with extends to provide fewer):

Group Tokens
color backdrop, bg, surface, text, heading, muted, primary, accent, border, code-bg, optional strong
font heading, body, mono, heading-weight
size base, h1, h2, h3, cover, quote, number, code
space slide-x, slide-y, gap
radius md

theme.css styles the layouts. Each slide is a section.pt-slide.layout-<name> containing .pt-content, whose children are .pt-b blocks with a kind class (.pt-h, .pt-p, .pt-list, .pt-code...). Use the tokens rather than literal values so that brand overrides keep working.

Use a local theme with theme: ./my-theme (relative to the deck).