5.6.4
Looks
Pick Vesper's look, accent color, photo collage and article lists, turn pages off, or make your own accent.
You pick the look in one file, src/theme.config.ts. It applies to both content sources. It has these settings:
look: the colors, the fonts and the photo treatment."clear"(cool neutral gray, Host Grotesk over Onest, the default),"field"(Field notes: warm paper, Vollkorn over Commissioner; the collage photos become prints with a one-line caption) or"trail"(Trail map: cool gray with a fine grain and contour lines behind the intro, Sora over Public Sans; the photos sit in an even mat inside a thin line). Only the chosen look’s fonts load.accent: links, buttons, the focus ring and small accent text."glacier"(lake blue, the default),"moss"(green),"alpenglow"(warm red) or"dusk"(violet).collage: the photo band on the home page."mosaic"(a wide grid past the text column, the default),"row"(one full-width row; two offset rows on smaller screens) or"sheet"(Contact sheet: an even sheet of frames).articleList: the lists on/articlesand on each category and tag page."grid"(cards in two columns, one on phones, the default) or"rows"(the home page’s rows: a square photo beside the text).thumbnails: the photo on each post in a list.false: the same rows and cards, text only.nowLine: the Now line under the intro on the home page.false: no line.pages:projects,speaking,usesandnow, eachtrueby default. See “Turn a page off.”builtWith: the small “Built with Astronomic” link in the footer. It isfalseby default. Set it totrueto credit the theme.
For example:
export const look: LookId = "field";
export const accent: Accent = "moss";
export const collage: Collage = "sheet";
pnpm check, pnpm dev and every build stop on an unknown value. A production server never fails on one. It uses the default instead and logs the bad value.
The collage
Each layout fills its rectangle exactly for 4, 5 or 6 photos, at desktop, tablet and phone widths: flush edges and one even gutter. Each photo has one corner cut at an angle, and the layout sets the corners so that neighbors’ cuts face each other. Hover or focus grows only that photo, in place. Nothing else moves.
Under reduced motion, nothing moves.
Turn a page off
Set a page to false in pages:
export const pages: Record<OptionalPage, boolean> = { projects: true, speaking: false, uses: true, now: true };
The page’s address then answers 404, and the nav, the footer, the sitemap, search, the feed and the home page drop it.
Light and dark mode
Light and dark mode follow the visitor’s system setting. The button in the nav lets them pick. The choice is saved in the visitor’s browser and applies on every page. A small script at the top of the page applies it before the page paints, so a visitor who chose dark never sees a light page first.
Make your own accent
An accent has four values: its color and the text on it, in light mode and in dark mode. The color is used as text, so it must have enough contrast on every look’s grounds. src/styles/accents/glacier.css describes each value.
- Copy a file in
src/styles/accents/, for examplemoss.csstoslate.css. - In the new file, change the id in the selector (
data-accent="slate") and change the four colors. - Add the accent to
src/styles/accents/accents.json: itsid, alabeland the same four values. - Add the id to
ACCENTSinsrc/utils/config.ts, and import the file insrc/styles/global.css, after the other accents. - Run
pnpm test:skins. It checks that each accent inaccents.jsonhas a file and an import, that the values match, and that the colors have enough contrast (WCAG AA) in Clear, Field notes and Trail map, in light and dark mode.
Words and share images
The theme’s own words, such as button labels, empty states and the list pages’ default titles, are in src/theme.strings.ts.
Every public page gets a 1200 x 630 share image. A post or project with its own photo uses that photo. The card’s mark follows your accent. Its font and colors are in src/share-card.ts.