@verbb/vitepress-theme
v1.0.0
Published
Shared VitePress theme (layout, sidebar, local search) for Verbb documentation sites.
Readme
@verbb/vitepress-theme
Shared VitePress theme used by Verbb documentation sites (custom layout, sidebar, outline, local search, primary-color tokens).
Usage
- Add the package and peer dependencies (
vitepress,vue), plus Tailwind v4 with@tailwindcss/viteand@tailwindcss/typographysosrc/custom.csscan be processed. - In
.vitepress/theme/index.ts:
import type { Theme } from 'vitepress';
import { createVerbbDocsTheme } from '@verbb/vitepress-theme';
const theme: Theme = createVerbbDocsTheme({
enhanceApp({ app }) {
// app.component('MyPreview', MyPreview);
},
});
export default theme;- In VitePress config, ensure the theme is compiled (not externalized) during SSR:
vite: {
ssr: { noExternal: ['@verbb/vitepress-theme'] },
plugins: [tailwindcss()],
},Set
themeConfig.navfor top-of-site section links (shown as a dropdown). Leavenavempty or omit it to hide the control.Optional:
themeConfig.docsTheme.primary(and otherdocsThemekeys) override CSS variables for accent colors.
Local file: dependency paths
Point file: at this folder from the package that runs VitePress. Examples from this workspace:
formie-plugin-repo/packages/docs→file:../../../verbb-vitepress-themeplugin-kit-repo/plugin-kit-react→file:../../verbb-vitepress-theme(two levels up toformie-react, not three)
