Themes and backgrounds
A theme is a deck’s look: colours, type, spacing and the style of every layout, in a light and a dark scheme. A background is what sits behind one slide’s content. For a walk-through, see Pick and customise a theme; this page is the reference.
Themes
Section titled “Themes”There are 16. Three ship inside the engine and need nothing installed:
| Theme | Look |
|---|---|
minimal |
The default: black on white, a wide sans serif, one accent. Dark mode inverts. |
rla |
Zinc-950 with a blue to violet ramp and dot-matrix headings, made for the animated backgrounds. |
stack |
An emerald accent on warm neutrals, Inter, product-like. |
none is a fourth built-in name with no styles at all, for a deck that brings all of its own CSS.
Fourteen more are npm packages, @kadal/theme-<name>:
| Theme | Schemes | Look | Adds |
|---|---|---|---|
ocean |
light, dark | Kadal’s own: the sea’s palette, calm gradients, Catamaran, Night Owl code | layouts waves, depth; <Wave> |
folio |
light, dark | Editorial: Playfair Display over Newsreader, booktabs tables, a drop cap | layouts pull-quote, essay, chapter; <Byline>, <Lede> |
swiss |
light, dark | A strict twelve-column grid, huge Inter Tight headings, one signal red, a running header | layouts poster, index, grid; <Rule> |
terminal |
light, dark | Mono headings, code blocks as editor windows, Ayu colours; dark first | layouts code, shell; <Terminal> |
lecture |
light, dark | Academic: numbered sections, a course footer, theorems and citations | layouts section, definition, theorem, references; <Theorem>, <Proof>, <Cite>… |
brand |
light, dark | Your company’s colours, logo and footer from themeConfig alone |
layouts title-logo, agenda, metrics; <Metric>, <Logo> |
crayon |
light, dark | Pastel stickers and speech bubbles for workshops and classrooms | layouts activity, cards; <Sticker>, <Bubble> |
neon |
dark | Synthwave for meetups and launches, with a solid print fallback | layouts launch, horizon; <Glow> |
classic |
light, dark | Avenir Next, light headings, square bullets, a cyan primary | layout cover |
seriph |
light, dark | PT Serif throughout, headings in the primary colour, a centred cover | layout cover |
crisp |
light, dark | Plain black on white, Helvetica Neue, pictures set in a margin | layouts intro-image, intro-image-right, image-right, 3-images, bullets |
bricks |
light | Building blocks in coral, butter, rose and sky, Sigmar One headings | layouts items, blank; <Polygon1>…<Polygon11> |
shibainu |
dark | Soft blobs in a shiba’s browns, Titillium Web, fourteen arrangements | layouts default-2…default-7, right, section-2, section-3 |
reveal |
light, dark | reveal.js’s twelve themes, picked with themeConfig.variant (black, white, league, beige, night, serif, simple, solarized, moon, dracula, sky, blood); what kadal-deck import reveal writes |
reveal’s --r-* custom properties |
The theme gallery shows each one in light and dark, with a link to its README: every
layout, component and themeConfig key it has. classic, seriph, crisp, bricks and
shibainu are ports of Slidev’s five official themes, and reveal ports reveal.js’s twelve; all
are MIT-licensed, and each package’s LICENSE carries the original copyright notice alongside the
port’s.
Choosing one
Section titled “Choosing one”Name it in the headmatter, after installing its package:
npm i @kadal/theme-seriphpnpm add @kadal/theme-seriphyarn add @kadal/theme-seriphbun add @kadal/theme-seriph---theme: seriph---theme: seriph finds a built-in theme first, then @kadal/theme-seriph, then
kadal-theme-seriph, then a package called seriph. theme: ./theme is a folder beside
deck.mdx. The Vite plugin imports the package’s CSS, layouts, components and layers for you, with
no line in src/main.tsx. A theme that isn’t installed stops kadal-deck dev and build with the
names it tried and the command that installs it.
Name themes in the headmatter rather than only in deck.config.ts: the headmatter is where they are
resolved. npx kadal-deck info themespnpm exec kadal-deck info themesyarn kadal-deck info themesbunx kadal-deck info themes lists every theme and addon the deck can see, with the layouts
each adds.
On deck.kadal.cc nothing needs installing: the hosted player carries every first-party theme
package. A theme it doesn’t have falls back to minimal, with a notice.
The theme menu
Section titled “The theme menu”T (or the palette button) opens the theme menu on every view: play, presenter and audience. It offers the deck’s themes and light or dark, and each screen keeps its own choice per deck in the browser, so a viewer who reads better on dark can have dark. D toggles dark and light directly.
themes: sets what the menu offers, resolved like theme: (install every package you list). The
default is [minimal, rla, stack]:
---theme: oceanthemes: [ocean, minimal, brand]---A theme picked from the menu brings its own layouts, layers, fonts (unless the deck set fonts:
itself) and code colours, and the deck’s own theme’s components stay available, so no slide breaks.
Code is highlighted at build time once for every distinct pair of code colours the menu needs, so
it recolours instantly. A slide whose frontmatter forces a scheme (colorScheme: dark) gets that
scheme’s tokens and code colours whatever the menu says.
Your own CSS on top
Section titled “Your own CSS on top”src/styles.css loads after the theme. Themes are built from CSS custom properties, so changing a
colour is usually one variable. Scope it to the theme’s class and set both schemes:
.theme-ocean { --deck-accent: #c2410c;}.theme-ocean[data-color-scheme="dark"] { --deck-accent: #fb923c;}The tokens every theme sets (--deck-bg, --deck-fg, --deck-muted, --deck-accent,
--deck-surface, the fonts…) are listed in Writing a theme.
Theme settings: themeConfig
Section titled “Theme settings: themeConfig”A theme’s knobs go in themeConfig. Each key arrives as a CSS custom property on the deck root, so
the theme, and your CSS, can read it:
---theme: seriphthemeConfig: primary: "#0f766e" # becomes --theme-primary---primaryColor becomes --theme-primary-color, a nested cover: { image } becomes
--theme-cover-image, a list becomes a comma list and a boolean 1 or 0. The deck’s values sit
over the theme’s own defaults. Layouts and layers read the raw values from
useDeck().config.themeConfig.
Brand: your company’s theme without CSS
Section titled “Brand: your company’s theme without CSS”brand takes everything that says “us” from themeConfig. Logos are files in public/:
---theme: brandthemeConfig: primary: "#2453d4" # the cover, links, numbers, the accent secondary: "#0f9d8a" # gradients, the second series, shapes on the cover logo: ./logo.svg # without one, the company's name is set as a wordmark logoDark: ./logo-dark.svg # the logo on dark slides company: Harbor Labs # the wordmark, the logo's alt text, the footer's default footer: "Harbor Labs · Q3 review · Confidential" # false hides the footer logoPosition: top-right # top-left · bottom-right · none---primaryInk sets the text colour on the primary (default white), and primaryDark and
secondaryDark override the colours on dark slides. It adds the layouts title-logo (the logo
large, the title, presenter: and date:), agenda (the slide’s list as numbered cards) and
metrics (a row of figures), and the components <Metric value="42%" label="Retention" delta="+6" />
and <Logo />.
Lecture: theorems, proofs and citations
Section titled “Lecture: theorems, proofs and citations”lecture numbers its sections, puts the course, author and page in a footer on every slide
(themeConfig: { course, author, institution, footer, sectionNumbers, accent }), and sets
mathematics the way a textbook does:
<Theorem n="2.1" title="Cauchy–Schwarz">
For all $u, v$: $|\langle u, v\rangle| \le \lVert u\rVert\,\lVert v\rVert$.
</Theorem>
<Proof of="Theorem 2.1">
Expand $\lVert u - t v\rVert^2 \ge 0$ and take the discriminant <Cite n={3} page="12" />.
</Proof><Definition>, <Lemma>, <Corollary>, <Proposition>, <Example> and <Remark> work like
<Theorem>; <Proof> ends with ∎. <Cite n={3} page="12" /> prints [3, p. 12], and
<Cite>Knuth 1984</Cite> prints (Knuth 1984). layout: references turns the slide’s numbered list
into a bibliography; layout: definition and layout: theorem (with n: and name:) make one
statement fill a slide.
fonts: as a list loads Google Fonts families exactly as written:
fonts: ["Inter:wght@400;600"]As an object it also points the theme’s font tokens at the families:
fonts: sans: Inter # body text, and headings unless `heading` says otherwise heading: Fraunces # headings only serif: Source Serif 4 # --deck-serif-font mono: Fira Code # code weights: "400,600,700" # default 300,400,600,700 italic: true # default false provider: google # google · bunny · none (load nothing; the fonts are local) local: [Helvetica Neue] # on the machine already: never fetchedfallbacks: false drops the system stack after each family. A family that lacks a weight costs only
that family. The deck’s fonts: replaces the theme’s, and exports wait for the fonts before taking
pictures.
Addons
Section titled “Addons”An addon is a feature any theme can use: components, layouts, layers, pages, CSS and a setup function. List them in the headmatter:
addons: [qr]qr finds @kadal/addon-qr, then kadal-addon-qr, then a package called qr (or a folder). Their
components and layouts merge in under the deck’s own and over the theme’s. To make one, see
Writing a theme.
On every slide: layers
Section titled “On every slide: layers”A footer, a logo or a slide number on every slide is a layer. Layers, extra buttons beside the controls and pages of the deck’s own are on Layers, controls and pages.
Changing a theme: theme eject
Section titled “Changing a theme: theme eject”npx kadal-deck theme eject # copies the deck's theme into ./themenpx kadal-deck theme eject --dir ./my-theme --forcenpx kadal-deck theme eject --theme seriph # another theme than the headmatter'spnpm exec kadal-deck theme eject # copies the deck's theme into ./themepnpm exec kadal-deck theme eject --dir ./my-theme --forcepnpm exec kadal-deck theme eject --theme seriph # another theme than the headmatter'syarn kadal-deck theme eject # copies the deck's theme into ./themeyarn kadal-deck theme eject --dir ./my-theme --forceyarn kadal-deck theme eject --theme seriph # another theme than the headmatter'sbunx kadal-deck theme eject # copies the deck's theme into ./themebunx kadal-deck theme eject --dir ./my-theme --forcebunx kadal-deck theme eject --theme seriph # another theme than the headmatter'sEject copies the deck’s theme (its stylesheet, its layouts and its package metadata) into the deck
and points the headmatter at the copy (theme: ./theme), touching nothing else in deck.mdx. The
copy keeps the theme’s name, so the deck looks exactly as before; from then on it is yours to change.
A built-in theme ejects too, as a package-shaped folder, and eject removes main.tsx’s import of the
built-in’s stylesheet so the two don’t fight. -C <deck> runs it on a deck in another folder.
To make a theme of your own to share, see Writing a theme.
Slide backgrounds
Section titled “Slide backgrounds”background: in a slide’s frontmatter (or in defaults: for every slide) sets what sits behind
it: a colour or gradient, a picture, a video, a web page, a background component such as
background: aurora, or a Pro library item such as background: pro/neon-drift.
Backgrounds has every form, the free built-in components with their props,
the Pro library, and the backgrounds removed in 0.6.