Inside the theme engine: 88 themes, one codebase

LinkMe ships 88 themes. They are not 88 templates copy-pasted into folders — they are 88 deliberate identities rendered by one engine. This is how it works.

Three layers, one contract

Every theme — full Astro themes and "pure" CSS-only themes — satisfies the same contract:

  1. Content slots — the engine passes each theme the same typed data: profile, links, sections, posts, projects. A theme decides how to render them, never what they are.
  2. Palette tokens — colors flow through CSS custom properties (--ps-surface, --ps-text, --ps-accent…). Dark mode is a token swap, not a second stylesheet.
  3. Registry truth — src/themes/registry.ts is the canonical list. The database registry self-heals from it on every boot: new themes appear, orphaned rows are pruned, sites on removed themes are migrated to a default automatically.
// The engine → theme contract (simplified)
interface ThemeProps {
  site: SiteRow;          // slug, display name, palette, about data
  sections: SectionMap;   // links, posts, projects, services, …
  plan: PlanFeatures;     // what this owner's plan allows
}

Palettes are a language, not a color picker

Each theme declares a default palette and accepts owner overrides through the same token set. Because every component reads tokens — never raw hex — a palette change re-skins the entire site coherently: cards, buttons, focus rings, charts.

TokenLight (Sage default)Dark equivalent
--ps-surface#ffffff#101613
--ps-text#181f25#e7efe9
--ps-accent#05b34d#2fd46f
--ps-border#d6ecdf#22302a

Tip

When you build a custom palette, keep text/surface contrast at WCAG AA (4.5:1) and let the accent do the personality. Two disciplined neutrals plus one confident accent beats six competing colors every time.

Pure themes: CSS-only identities

"Pure" themes are the lightweight end of the range: a single stylesheet mapped onto the shared markup, no per-theme JS. They cost almost nothing to load and inherit every engine feature — plugins, dark mode, RTL — for free.

The self-healing registry

On boot, the engine reconciles the code registry with the database: adds missing rows, updates metadata, deletes orphans, and migrates any site pointing at a theme that no longer exists. The admin DB console lists the registry as a tracked seed dataset — green means the picker can never go stale.

Important

Themes never hardcode content. The moment a theme "knows" about one owner's data, it stops being a theme and becomes a bespoke site — the engine's contract exists precisely to keep 88 identities maintainable by one team.

Why this matters to you

For owners: switch identities in one click with zero content lock-in. For contributors: add a theme by satisfying a small, typed contract — the engine handles hosting, previews, dark mode and the picker automatically.