The theme setting controls how the HTML site looks. It has five keys, and each has a default:
theme:
preset: reef # site shape
palette: harbor # colors
mode: system # light, dark, or system
toggle: true # reader switch for light and dark mode
fonts: system # optional: turn off the preset's bundled fonts
Omit theme to keep the default: the shoal preset, the kelp palette, the preset's fonts, and light mode only. An unknown value fails the build.
To see every combination on a real page, open Try a theme.
Start with a preset. Change the palette if its colors don't fit your brand. Set the mode if readers need dark mode. Use project CSS for anything else.
Presets
A preset sets the shape of the site. It controls layout, corner radii, and type, and how panels, navigation, and cards look. Each preset has a default palette. Any palette works with any preset.
| Preset | Shape | Default palette |
|---|---|---|
shoal |
Flat page with a ruled sidebar and square-cornered controls. | kelp |
reef |
Rounded panels float on a tinted page. Navigation items and controls are pills. | coral |
ledger |
A technical manual with an inked masthead, serif body text, monospace headings, numbered sections, and hard-edged cards. | ink |
vice |
A night masthead with a sunset stripe, bold italic display type, neon section rules, and cards that glow on hover. | vice |
Presets change CSS only. Page markup, URLs, and Markdown twins stay the same.
Fonts
Each preset ships its own fonts, so the site looks the same on every operating system:
| Preset | Body | Headings | Code |
|---|---|---|---|
shoal |
Inter | Inter | System monospace |
reef |
Figtree | Figtree | System monospace |
ledger |
Source Serif 4 | JetBrains Mono | JetBrains Mono |
vice |
Figtree | Jost | System monospace |
The fonts are Latin variable fonts under the SIL Open Font License. The build copies them to /assets/fonts/ with their license files. A browser downloads only the faces a page uses, and the page preloads its body font. Characters outside the Latin set use the system fallback. Until a font arrives, the page uses a local font resized to match it. Text doesn't shift when the bundled font loads. Agents read the Markdown twins, which load no fonts.
To use system fonts only, set fonts: system. Each preset then falls back to its system font stack.
Use your own fonts
Set any of body, headings, and code. A role you leave out keeps the preset's font. headings defaults to the body font.
theme:
preset: reef
fonts:
body:
family: Acme Sans
files:
- ./fonts/AcmeSans.woff2
- { file: ./fonts/AcmeSans-Italic.woff2, style: italic }
headings: Acme Display
code:
family: Berkeley Mono
files: [./fonts/BerkeleyMono.woff2]
familyis the name CSS uses. A plain string, such asheadings: Acme Display, names a font without shipping files. Use it for a font that project CSS loads, or one installed on readers' machines.fileslists local.woff2,.woff,.ttf, or.otffiles, relative to the config file that declares them. The build copies them to/assets/fonts/project/. File names can use letters, numbers, dots, dashes, and underscores, and two files can't share a name.- Each file can set
style(normaloritalic) andweight, such as400or"100 900". The default weight,"100 900", suits variable fonts; give each static file its own weight.
A missing file, an unsupported format, or an unknown key fails the build. Check that your font license allows web embedding.
Fonts set here become the --font-body, --font-heading, and --font-code CSS tokens, each followed by a system fallback.
Load order
The HTML page links stylesheets in this order. Later files override earlier ones.
/assets/site.css, which imports the base tokens and header styles./assets/theme-preview.cssfollows it, on pages that use the theme previewer.
/assets/theme.css, for a preset other thanshoal./assets/palette.css, generated for any palette or mode other thankelpin light mode./assets/fonts.css, generated fromtheme.fonts, unless it'ssystemand sets nothing./assets/project.css, fromsite.customCss.
When a site uses a non-default preset, palette, or mode, the html element carries data-theme and data-palette. The ledger and vice presets also set data-masthead="inked", which switches header tools to light text on a dark masthead. Project CSS can target one combination:
[data-theme="ledger"] .page-head h1 { letter-spacing: 0; }