stnd.build

Add Anything to Standard

How to add custom fonts, themes, UI components, routes, and hooks to any Standard project without touching the framework source code.

Whether you installed Standard via npm install @stnd/core in a standalone repository or work inside a multi-app workspace, you never need to modify the framework’s source code to extend it.

In Standard, almost everything — a typeface, a color theme, a UI component, a page route, an API endpoint, or a command-palette action — is just a module (index.module.js) dropped into your project’s ./modules/ folder, or a set of frontmatter tokens in your root Markdown note.

Quick Decision Matrix

What you want to add Where it lives in your project Files required
Personal site palette & fonts (Markdown / Vault) Root index.md YAML frontmatter 0 extra files (cascades to all notes)
A custom or licensed commercial font modules/font-<name>/ <name>.css + index.module.js
A custom theme modules/theme-<name>/ <name>.scss + index.module.js
Custom UI components or header/sidebar widgets modules/<feature>/ .astro / .svelte + index.module.js (hooks or aliases)
Pages, API endpoints, or Launcher commands modules/<feature>/ routes/ + index.module.js
Private fonts/themes shared across multiple apps Private workspace package ("private": true) Loaded via moduleLoad in astro.config.mjs

1. Add a Personal Look with Zero Files (index.md Frontmatter)

If your site is driven by Markdown notes or an Obsidian vault (@stnd/press / Standard Garden), you do not even need a theme module to define your visual identity.

Any design token placed in the YAML frontmatter of your root index.md automatically cascades as the default design for your entire site (while still allowing individual notes to override specific tokens):

---
title: My Studio
color-light-background: "#FFFCF0"
color-light-foreground: "#4D3A0B"
color-light-accent: "#AD8301"
color-dark-background: "oklch(0.23 0.002 67)"
color-dark-foreground: "oklch(0.77 0.023 96)"
font-text: "Instrument Sans"
font-header: "Inter"
font-header-weight: 900
font-header-letter-spacing: "-0.05em"
ratio: 1.25
density: 1.45
reading-width: "40rem"
---

From color-light-background and color-light-foreground alone, @stnd/styles computes the full surface elevation ladder, hairline borders, and semantic status colors.


2. Add a Custom or Licensed Font (modules/font-<name>/)

Open-source packages (@stnd/fonts) cannot ship commercial typefaces (such as Cargo Diatype, Berkeley Mono, MonoLisa, or Helvetica Now). In your own project, simply drop your licensed .woff2 files into a local module under ./modules/:

my-app/
└── modules/
    └── font-diatype/
        ├── fonts/
        │   └── CargoDiatype.woff2
        ├── diatype.css
        └── index.module.js
/* modules/font-diatype/diatype.css */
@font-face {
  font-family: "Cargo Diatype";
  src: url("./fonts/CargoDiatype.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
// modules/font-diatype/index.module.js
export default {
  id: "font-diatype",
  name: "Custom Font :: Cargo Diatype",
  meta: { type: "font", label: "Cargo Diatype" },
  styles: ["./diatype.css"],
};

@stnd/core discovers modules/font-diatype/index.module.js automatically at build time and bundles the @font-face rules into virtual:stnd/styles.


3. Add a Custom Theme (modules/theme-<name>/)

A theme is just a module whose stylesheet scopes token overrides to [data-theme="<name>"]:

my-app/
└── modules/
    └── theme-maker/
        ├── maker.scss
        └── index.module.js
/* modules/theme-maker/maker.scss */
:root[data-theme="maker"],
[data-theme="maker"] {
  --color-light-background: #f7f3ee;
  --color-light-foreground: #4a341c;
  --color-light-accent: #d69a00;
  --color-dark-background: #231e1a;
  --color-dark-foreground: #e6cfb3;
  --font-text: "Cargo Diatype", var(--font-sans);
  --font-header-weight: 800;
}
// modules/theme-maker/index.module.js
export default {
  id: "theme-maker",
  name: "Custom Theme :: Maker",
  meta: { type: "theme", themeId: "maker", label: "Maker" },
  styles: ["./maker.scss"],
  dependencies: ["font-diatype"], // Guarantees the font module loads first
};

To make it your application’s default theme, set theme: "maker" in modules/core/index.module.js (or astro.config.mjs).


4. Add UI Components & Mount into Core Layouts

You can build your own Astro or Svelte components using Standard’s semantic tokens (var(--color-surface-raised), var(--border), var(--space)) and either import them directly or inject them into @stnd/layout/Base and @stnd/layout/Panel using Hook Zones:

my-app/
└── modules/
    └── studio-ui/
        ├── components/
        │   ├── StatusPill.svelte
        │   └── StudioCard.astro
        └── index.module.js
// modules/studio-ui/index.module.js
export default {
  id: "studio-ui",
  name: "Studio UI Extensions",
  // 1. Expose clean import aliases for your routes:
  aliases: {
    "@studio/ui": "./components",
  },
  // 2. Or mount directly into @stnd/layout slots without editing Base.astro:
  hooks: {
    "header:actions": "./components/StatusPill.svelte",
  },
};

5. Add Routes, API Endpoints & Launcher Commands

Every feature slice in ./modules/<feature>/ can register pages, server endpoints, and keyboard-launcher commands in one manifest:

// modules/portfolio/index.module.js
export default {
  id: "portfolio",
  routes: [
    { path: "/work", entrypoint: "./routes/index.astro" },
    { path: "/api/work.json", entrypoint: "./routes/api.ts" },
  ],
  config: {
    nav: [{ title: "Work", url: "/work" }],
  },
  hooks: {
    "launcher:action": ["./commands/open-portfolio.js"],
  },
};
Tip

The Modularity Litmus Test: Delete modules/portfolio/ and run pnpm build. The routes, nav links, and launcher commands disappear cleanly, and the application continues to run without a single broken import.


6. Share Private Fonts & Themes Across Multiple Apps

If you maintain several personal or client websites in a workspace and want to reuse your licensed fonts and personal themes (maker, blueprint, etc.) without publishing them to npm:

  1. Create a private workspace package (for example packages/private-atelier/package.json with "name": "@atelier/pack" and "private": true).
  2. Place your font and theme module folders inside it.
  3. Load the ones you want in any app’s astro.config.mjs:
// apps/my-site/astro.config.mjs
import { defineConfig } from "astro/config";
import standard from "@stnd/core";

export default defineConfig({
  integrations: [
    standard({
      theme: "maker",
      moduleLoad: [
        "@atelier/pack/fonts/diatype",
        "@atelier/pack/themes/maker",
      ],
    }),
  ],
});