Adopting it in a project
Every vaam-apps project documents itself in its own repository, so the docs ship with the code they describe. This page is the checklist for giving a project a docs site — or moving an existing VitePress site onto the house theme.
Moving an existing VitePress site
A site already on VitePress's default theme (for example vpay-docs) moves over in three changes; its nav, sidebar, socialLinks, editLink, custom components and markdown all keep working.
Add the dependency:
shpnpm add -D @vaam-apps/vitepress-md3In
.vitepress/config.ts, swapdefineConfigfordefineMd3Configand addmd3tothemeConfig:tsimport { defineConfig } from "vitepress"; import { defineMd3Config } from "@vaam-apps/vitepress-md3/config"; export default defineConfig({ export default defineMd3Config({ themeConfig: { md3: { seed: "#0f766e" }, nav: [/* unchanged */], }, });In
.vitepress/theme/index.ts, extend this theme instead of the default one:tsimport DefaultTheme from "vitepress/theme"; import Md3Theme from "@vaam-apps/vitepress-md3"; export default { extends: DefaultTheme, extends: Md3Theme, };
Then delete brand overrides such as --vp-c-brand-1 from your custom CSS: the seed colour generates them, and hand-set values would fight the light/dark schemes.
Custom colours in your own CSS
Any colour you hard-code will not follow the scheme. Use the tokens instead — var(--md-sys-color-primary), var(--md-sys-color-surface-container), var(--md-custom-color-success-container) — and your components follow light, dark, and the reader's style choice for free.
A new project's docs
- Create the site in the project's repository (a
docs/folder is the convention) with the two files from Getting started. - Choose a seed: the project's own brand colour, or the vaam teal
#0f766eif it has none. - Deploy it with GitHub Pages. This repository's
pages.ymlis a working example that passes the rightbasepath in. - List it on the hub: add an entry to
docs/.vitepress/projects.ts, with the repository's own GitHub description.