Themes
Every token the engine reads has a default (Theme tokens, declared in styles/tokens.css), and the defaults are the default theme: a light page, Gelasio (a web font with Georgia's metrics), a blue accent, a light code window. The library ships it with five more, each with a character of its own (dark, light, editorial, vivid, terminal): Built-in themes. Every deck can wear them (arao({ builtinThemes }) turns them off, all or some), and default is always there.
A project theme declares only what it changes. This one is the examples' (docs/examples/themes/; in a slides project, src/themes/ocean.css), with a deck that wears it:
/* docs/examples/themes/ocean.css: a theme declares only the tokens it changes */
[data-theme="ocean"] {
--ar-bg: #1b2a3a;
--ar-fg: #edf1f4;
--ar-muted: #9aabbb;
--ar-accent: #6aaee8;
--ar-accent-fg: #1b2a3a;
--ar-letterbox: #111c27;
--ar-font-sans: "Inter", system-ui, sans-serif;
--ar-title-align: center;
--ar-footer-color: var(--ar-accent);
}<template lang="pug">
Deck(:themes="['ocean', 'sage', 'midnight', 'default']")
template(#footer="{ number, total }")
span ACME · DevConf 2026
span {{ number }} / {{ total }}
Slide.top(layout="grid" align="start" text-size="1em")
h2 Same slides, another venue
div
h3 #[Icon.accent(name="lucide:palette")] Colours
p Background, text, accent
div
h3 #[Icon.accent(name="lucide:type")] Type
p Fonts and their sizes
div
h3 #[Icon.accent(name="lucide:panel-bottom")] Zones
p Title, body, footer
</template>
Every token, with its default: Theme tokens.
Where themes are found
A theme is a CSS rule [data-theme="<name>"] { --ar-…: …; } in a CSS file of a theme source: the library's own themes folder (its built-in themes); then the project's themes folder (src/themes), or any folder or package named in the plugin's themes option. It declares only the tokens it changes, over the defaults. The plugin loads every CSS file directly in each source's folder, after the engine's CSS, with nothing to import, and names the themes by their selectors:
- a theme's name is the one in
[data-theme="<name>"](quoted or not), not the file's: one file may hold several themes ([data-theme="venue"]and[data-theme="venue-dark"]), and rules for several at once ([data-theme^="venue"] { … }, which names none by itself); comments do not count; - a file that names no theme is still loaded (shared rules,
@font-face) and Vite warns about it; - a selector inside
:not(…)names no theme; a name is read as the browser reads it (CSS escapes resolved, nothing trimmed), and one with white space in it is no theme's (Vite warns and it is skipped); - subfolders hold what the themes use (pictures,
@import-ed partials) and are not loaded on their own. The plugin follows a file's@importof a local partial (a path relative to the file, or from the project's root,/styles/x.css), all the way down, and its selectors name themes too; an@importof a package or a URL is not followed; - a file added, removed or renamed while
npm run devruns is picked up, and so is an edit of a partial it imports (the page reloads when the theme names change).
Where a theme can come from. Only from the theme sources: the library's own, which needs no option, and arao({ themes }) in vite.config.js, the project's: one, or a list, in order (default 'src/themes'):
// vite.config.js
import arao from 'araojs/vite'
export default defineConfig({
plugins: [arao({ themes: ['src/themes', 'src/styles/venues', 'arao-themes'] })],
})- a folder: a path from the project's root, or absolute (
'src/themes','../shared/themes'). The rule: a bare lowercase name ('themes','@acme/x') is a package; anything else is a folder, so a folder right at the root is written'./themes'. - a package: an npm name (
'arao-themes','@acme/arao-themes'), installed in the project (npm i -D arao-themes). A theme package publishes plain CSS files, no build step needed (minified is fine), in athemes/folder at its root; one that keeps them elsewhere says so in itspackage.json:"arao": { "themes": "dist" }(a folder inside the package). A linked package (file:,npm link, a workspace) works the same, watched where its files really are. A package that is not installed, or whose folder gives no theme, stops the build with an[arao]error.
Every theme the sources give is offered: default first, then the project's, source after source (alphabetical in each), then the built-in ones. A name two of the project's sources give is offered once, where it comes first, and Vite warns: both files are loaded, source after source, and both apply; at equal specificity the later source wins.
A project theme named like a built-in one (src/themes/folio.css with [data-theme="folio"]) replaces it: the built-in file is not loaded at all (nor the fonts it names), so the project's theme looks exactly as it says, over the defaults, and Vite says so once (theme "folio" of src/themes replaces the built-in one). To start from a built-in theme, copy its file (node_modules/araojs/themes/<name>.css) into src/themes/: under the same name it replaces the built-in one, under another the deck offers both. A project's default replaces the built-in default, which sets nothing: it refines the defaults while a deck wears it.
The built-in themes to load: arao({ builtinThemes }), true by default (all of them), false (none but default), or a list of their names (['folio', 'carbon']; another name stops the build). A built-in theme left out is not in the build at all: no CSS, no fonts, no name to offer.
A CSS file the project imports itself (from src/main.js, a .scss file, a deck's own <style>) is no theme source: its rules apply, but a [data-theme] in it is not a theme a deck can list. Put its folder, or its package, in themes instead.
Deck(:themes) picks the themes a deck can wear, in its order (the first is the one it opens in); without it, the deck offers every theme there is: default, the project's, then the built-in ones, each source in alphabetical order. A name there that no source gives (above) is skipped, with one [arao] warning; a list left with no theme is ['default']. ?theme=<name> and t (or the controls' picker) change the theme while presenting; useDeck().themes is the deck's list.
Overriding tokens
Where tokens apply, from weakest to strongest:
- the defaults, declared at the root with zero specificity (
:where(:root)): they reach everything Arao draws, inside a theme or not (the presenter view and its notes, the deck list); - any rule of the project's own,
:root { --ar-accent: … }included, which wins over a default; - the theme's rule, on the element that wears it (the audience's window, each slide area of the presenter view, the export's book);
- a token set on any element inside (a layout, a slide, a table,
style="--ar-…").
So a plain :root rule reaches default, and the tokens a theme leaves alone, but no further: each theme declares its tokens on the element that wears it ([data-theme="aurora"]), and an element's own declaration beats the value it inherits from :root. To change a token from the project's own CSS:
- in every theme:
:root, [data-theme] { --ar-accent: … }; - in one theme:
[data-theme="aurora"] { … }; - where a theme sets it inside a layout (aurora, meridian and terminal give
.layout-sectiona background of their own):[data-theme] .layout-section { … }, scoped as the theme scopes it.
/* src/styles/brand.css, imported in src/main.js after araojs */
:root, [data-theme] { --ar-accent: #e8590c; } /* every theme */
[data-theme="aurora"] { --ar-accent-fg: #fff; } /* aurora only */
[data-theme] .layout-section { --ar-slide-bg-image: none; } /* sections, in every theme */[data-theme] weighs the same as [data-theme="aurora"], so these rules win over a theme's by coming later: the project's CSS must load after araojs's. It does where it usually goes, a file imported in src/main.js after import … from 'araojs', or a deck's <style> block. A slide's own value (an attribute, style="--ar-…") still wins over them. The theme picker's swatches follow too: each shows what its theme wears, so a colour overridden in every theme shows in all of them.
Layouts have tokens too, --ar-layout-<layout>-<thing> (the section's colours, the cover's title size, which layouts show the footer, the image layouts' proportions), set in a theme like any other: [data-theme="venue"] { --ar-layout-section-bg: #0b3d2e; --ar-layout-cover-footer: flex; } (Layout tokens); on one slide each is also an attribute (Slide(layout="section" bg="#0b3d2e"): Layout parameters). So is where a slide's body sits: --ar-body-align: center centres every body, as decks used to by default.
Their colours and sizes default to the design-system tokens above (the section's background is --ar-accent, the cover's title a multiple of --ar-title), so changing --ar-accent restyles every layout at once; set a layout's own token only to set it apart.
A token whose default is another token (--ar-footer-color is --ar-muted, the slide title's colour is --ar-accent) follows that token wherever it is read: a theme that changes --ar-muted changes the footer too, unless it sets --ar-footer-color. The deck's own interface (the controls, the presenter view, the export's notes pages) has tokens too: a theme restyles the controls and the notes pages (they sit inside it); the presenter view sits outside every theme, so its tokens are set at :root.
Another theme
/* src/themes/venue.css: found and loaded by the plugin; Deck(:themes) may name 'venue' */
[data-theme="venue"] {
--ar-letterbox: #111; --ar-bg: #fff; --ar-fg: #222; --ar-muted: #777;
--ar-accent: #0a7;
--ar-font-sans: system-ui, sans-serif;
--ar-title: 88px; --ar-radius: 12px;
--ar-code-bg: #f6f8fa; --ar-code-bar: #e6e8eb;
}In a slide, style through tokens (color: var(--ar-accent), background: color-mix(in srgb, var(--ar-fg) 8%, var(--ar-bg))) rather than fixed colours or fonts: a venue-specific look is a new theme, not edits to slides.
Fonts
A theme names its fonts in its tokens, and the build fetches them:
[data-theme="venue"] {
--ar-font-heading: "Space Grotesk", sans-serif;
--ar-font-sans: "Inter", sans-serif;
--ar-font-mono: "JetBrains Mono", monospace;
}--ar-font-heading is the headings' font (h1 to h6 in a slide); without it they keep the text's.
The Vite plugin reads the families in font-family declarations and in the --ar-font-* tokens. For a family that no stylesheet declares with @font-face and that is not a system font, it asks the font providers in turn: Google Fonts, Bunny Fonts, Fontshare, Fontsource and npm (a font package the project installed). It puts the files in the build (assets/_fonts) and adds the @font-face rules, plus fallbacks with matched metrics so the text does not jump when the font arrives. The dev server serves the same files, and the PDF export waits for them. This is fontless, the engine of Nuxt Fonts.
It is on by default: a theme that already names a web font (Inter, Roboto…) now gets it, where before the text fell back to a font of the machine.
What it fetches: weights 400, 600 and 700, each upright and italic, in every subset the provider splits the font into (the browser downloads only the subsets a page uses). With a variable font, one file covers the weights.
System fonts are never fetched: fontless's own list (Georgia, Helvetica, Times New Roman, Segoe UI, Menlo, Courier New, Verdana, Tahoma…) and the plugin's (Arial, Calibri, Futura, Gill Sans, Palatino, Trebuchet MS, SF Pro… in vite/fonts.js). Generic names (sans-serif, system-ui, ui-monospace) never are either.
Limits
- Only families a provider has. For another font, write its
@font-facein the theme file, pointing at its files: a family declared with@font-faceis left alone. - The build asks the providers. Each family name goes to Google, Bunny, Fontshare and Fontsource at build time (the deck's viewers never contact them: the files are served with the deck). Turn it off for a family, or altogether, below.
- The defaults name one too: Gelasio,
default's text font, is in the engine's own CSS, so every build fetches and ships it, whatever the themes: six files (a variable font, upright and italic, in three subsets), about 180 KB.fonts: false, orfonts: { families: [{ name: 'Gelasio', provider: 'none' }] }, leaves it out, and the text falls back to Georgia (or the system's serif). - The built-in themes name fonts too, thirteen families between them: with all of them loaded (the default), every build fetches and ships them, about 140 files, some 2.6 MB in
assets/_fonts(a viewer's browser downloads only the files of the theme on screen). So even a project whose own themes use only system fonts ships them, on top of Gelasio's six; offline, its build takes longer and warns for each family the providers do not answer.arao({ builtinThemes: false }), or the list of the ones the decks wear, keeps the others' fonts out;fonts: falsefetches none, and the built-in themes fall back to system fonts. - Network at build time. The files are cached in
node_modules/.cache/fontless, but the providers' catalogues are cached for a week only (and again on a new version), and a fresh install (npm ciin CI) starts empty. Offline, or with a provider that does not answer (a timeout,ETIMEDOUT), a build still passes: fontless and the plugin warn ([arao] fonts: …; fontless's own warnings cannot be quieted, not even byarao export), and the text uses the family's next fonts. To fail the build instead (CI), setfonts: { throwOnError: true }. - Behind a proxy (
HTTPS_PROXY), fetching goes through it on Node 22.19 or later only (the proxy support needs a newerundicithan Node 20 runs; npm may warn about its engine on install). On older Node a build behind a proxy gets no fonts, as offline. --ar-ui-font(the controls and the presenter view) is not read: use a system font, or name the family infamilieswithglobal: true(fonts: { families: [{ name: 'Inter', global: true }] }), which loads it on every page.- The licence is the font's. The providers above serve open fonts.
Options: arao({ fonts: false }) turns it off. An object is passed to fontless, over the plugin's defaults, key by key: defaults (weights, styles, subsets), providers, priority, families, throwOnError…
arao({
fonts: {
defaults: { weights: [400, 700] },
families: [
{ name: 'Brand Sans', provider: 'none' }, // never fetched (its @font-face is ours)
{ name: 'Inter', provider: 'bunny' }, // from Bunny only
],
throwOnError: true, // a font that cannot be fetched fails the build
},
})Sizes
Rules of thumb for a 1920x1080 canvas (and what the defaults do):
- Safe margin ≈ 5–7 % of each side, for projectors that crop the edges:
--ar-pad-yand--ar-pad-x(110 x 140 px). - Header ≈ 12–15 % of the height for the title zone (a band, if any:
--ar-header-height). - Footer ≈ 5–8 % of the height: the default band is 88 px, in the bottom padding (which is made at least as tall where the footer shows), with 24 px text.
- Body text 36–44 px (
--ar-text-base: 42 px); nothing under ≈ 28 px except the footer and dense code.