Template Vanilla Site MIT
Documentation Site
A premium, minimal, light-mode-first developer-documentation template for DevSnips built with plain HTML, CSS (Pico CSS foundation), and vanilla JavaScript. Split into modular files: code.html (HTML structure) + style.css (the design system) + script.js (router, content, interactions), with preview.html as a self-contained single-file preview of the UI. Layout: header + nested left documentation sidebar + main content + sticky On-this-page TOC. Covers 15 documentation sections (Documentation Home, Introduction, Getting Started, Installation, Quick Start, Vanilla, Components, Templates, Design Tokens, Guides, API Reference, Examples, FAQ, Changelog, Roadmap, Contributing) via hash routing. Includes nested sidebar navigation with active page state, breadcrumbs, sticky scrollspy table of contents, previous/next navigation, a Cmd+K search command palette, code blocks with a lightweight syntax highlighter, copy buttons, tabbed code blocks, callouts, responsive tables, badges, API reference blocks, an edit-on-GitHub action, last-updated metadata, and opt-in light/dark mode. Neutral-first design with one blue accent (never violet/neon), hairline borders, restrained shadows, light code blocks, and editorial typography — following the shared design-tokens.md specification. Fully responsive: sidebar becomes an off-canvas drawer, TOC becomes a collapsible panel, code blocks remain usable, tables adapt without page overflow, from 320px to 1920px. No React, Vue, Next.js, Tailwind, Bootstrap, backend, database, or CMS.
- Vanilla
- HTML
- Pages
- Site
- Stack
- Vanilla HTML/CSS/JS + HTML
- Theme
- System
- Responsive
- Yes
- Files
- 9
- License
- MIT
Preview
The whole site, live.
Scroll inside the frame, switch viewports, or open the raw preview in a new tab — it is the same file the CLI installs.
devsnips.dev/templates/vanilla/documentation-site/ What's inside
Everything the folder ships.
Straight from the registry's metadata — every line maps to a file you can open in the source tabs below.
- hash-routed single-page app
- 15 documentation sections
- nested sidebar navigation
- active page state
- breadcrumbs
- sticky scrollspy TOC
- previous/next navigation
- Cmd+K search command palette
- syntax-highlighted code blocks
- copy buttons
- tabbed code blocks
- callouts (info/note/tip/warning/danger)
- responsive tables
- status badges
- API reference blocks
- edit-on-GitHub action
- last-updated metadata
- reading-time estimate
- opt-in light/dark mode
- mobile sidebar drawer
- collapsible mobile TOC
- nav filter
- reduced-motion safe
- focus-visible rings
- keyboard operable
- Pico CSS foundation
- modular file split (code.html + style.css + script.js)
Technical
Stack, scripts, structure.
Everything you need to know before you install.
root 4
-
AGENTS.mddoc -
metadata.jsonconfig -
preview.htmlpreview -
README.mddoc
assets/ 2
-
favicon.svgasset -
logo.svgasset
pages/ 3
-
code.htmlcode -
script.jscode -
style.csscode
Install
One command, whole folder.
Pulls the template into your project through the DevSnips CLI. The registry path below is stable across the CLI, MCP server and Skills.
npx devsnips add Vanilla/Templates/documentation-site Vanilla/Templates/documentation-site AI-ready
Hand the whole job to your agent — Cursor, Cline, Claude Code or Windsurf. One prompt installs the template, fixes the theme toggle, optimises it and reshapes it for what you are building.
Scaffold the DevSnips template "Documentation Site" (Vanilla/Templates/documentation-site) into this project, then audit, fix and tailor it. 1. Install — if the DevSnips MCP server is connected, fetch the resource with get_resource(id="Vanilla/Templates/documentation-site"). Otherwise run npx devsnips add Vanilla/Templates/documentation-site and install the dependencies the template declares. 2. Audit — check the template end to end before changing anything: theme toggling (dark/light), responsive behaviour, accessibility, unused files and assets. 3. Fix — repair what the audit found, starting with the theme toggle: it must persist across reloads, never flash the wrong theme on first paint, and every component must read the same tokens in both modes. 4. Optimise and adapt — trim what the site does not need, then customise the template for the product being built here: replace the placeholder branding, copy, imagery, navigation and routes so it reads as this project rather than as a demo.
devsnips://templates/documentation-site The same path the CLI, MCP server and Skills resolve — one registry, one resource URI.
Source
Read it before you ship it.
The README, manifest and entry document — verbatim, straight from the registry.
# Documentation Site Template (Vanilla)
A premium, minimal, **light-mode-first** developer documentation template built
for DevSnips with plain HTML, CSS (Pico CSS foundation), and vanilla JavaScript.
The template is split into modular files — `code.html` (HTML structure) +
`style.css` (the design system) + `script.js` (router, content, interactions) —
with `preview.html` as a self-contained single-file preview of the UI so you can
open it directly and see exactly how the template looks.
**Technology:** vanilla
**Category:** templates
**Subcategory:** documentation-site
**Type:** single-page (15 documentation sections, hash-routed)
## Files
```
Documentation Site/
├── code.html # HTML structure (links style.css + script.js) — the modular source
├── style.css # the design system (Pico CSS foundation + DevSnips --ds-* tokens)
├── script.js # router + content (15 sections) + interactions (vanilla JS, no deps)
├── preview.html # single-file preview of the UI (inlines style.css + script.js) — open this to see it
├── metadata.json # DevSnips registration metadata
├── README.md # This file
└── assets/
├── logo.svg # DevSnips [D] mark
└── favicon.svg # DevSnips favicon
```
## Preview
Open `preview.html` directly in a browser to see the template — it is a
self-contained single-file preview that inlines the CSS and JS:
```bash
cd "Vanilla/Templates/documentation-site"
python3 -m http.server 8080
# visit http://localhost:8080/preview.html
```
For development and customization, work with the split files — open `code.html`
(which references `style.css` and `script.js` relatively) in the same served
folder. The whole template runs without a build step. The only external requests
are Google Fonts (Inter + JetBrains Mono) and Pico CSS, both from CDNs.
Per the shared `design-tokens.md` convention, the template folder contains
exactly **one** `preview.html`. It is the canonical preview shown by the DevSnips
website. It is fully responsive, uses the template's real CSS/JS, uses relative
paths, and loads correctly when opened directly.
### Architecture
The template is split into three modular files plus a single-file preview:
- **`code.html`** — the HTML shell (header, sidebar, main, TOC, search modal,
drawer) that links `style.css` and `script.js`. This is the modular source you
customize.
- **`style.css`** — the entire design system: Pico CSS overrides, the `--ds-*`
token layers, and every component style.
- **`script.js`** — the runtime + content: a `NAV` config drives the nested
sidebar, a `PAGES` object maps each section ID to a content-builder function,
and the runtime handles routing, scrollspy, search, code tools, theming, and
the mobile drawer. All content for all 15 sections lives here — there are no
separate `pages/`.
- **`preview.html`** — a self-contained single-file preview that inlines
`style.css` and `script.js` into the `code.html` structure, so it can be opened
directly with no build step and renders identically to the modular version.
### Sections (15)
| Group | Sections |
|---|---|
| **Start** | Documentation Home, Introduction, Getting Started, Installation, Quick Start |
| **Library** | Vanilla, Components, Templates, Design Tokens |
| **Reference** | Guides, API Reference, Examples, FAQ |
| **Project** | Changelog, Roadmap, Contributing |
### Design system
The template extends the shared DevSnips `--ds-*` token system (defined in
`Vanilla/Templates/design-tokens.md`) with a handful of `--template-*` variables
that adapt — never override — the global language. It is **neutral-first** with
one controlled **blue-600** accent (never violet/neon), hairline 1px borders,
restrained shadows, an Inter + JetBrains Mono type scale, a base-4 spacing
scale, and small radii by default. Light and dark mode are supported via a
`data-theme` attribute on `<html>` with a no-flash system-preference fallback.
## Features
- **Single SPA** covering all 15 documentation sections via hash routing
- **Nested sidebar navigation** with four groups, expandable parents, active
page state (`aria-current`), and a live filter input
- **Breadcrumbs**, **last-updated metadata**, **reading-time estimate**, and an
**edit-on-GitHub** action on every content page
- **Sticky scrollspy table of contents** generated per page from `h2`/`h3`
headings via `IntersectionObserver`; collapses to a tappable panel below 1180px
- **Previous/next navigation** at the foot of every content page
- **Cmd+K (and `/`) search command palette** — arrow-key navigation, Enter to
open, Esc to close, grouped results with matched-term highlighting
- **Code blocks** with a lightweight vanilla-JS syntax highlighter
(HTML, CSS, JS, JSON, Bash), a language label, and a **clipboard copy button**
- **Tabbed code blocks** (e.g. npm/pnpm/yarn) with ARIA tablist semantics
- **Five callout variants** — info, note, tip, warning, danger
- **Responsive tables** in `overflow-x:auto` wrappers (never cause page overflow)
- **Status/category badges** — stable, beta, deprecated, accent, neutral, solid
- **API reference blocks** with signature, return type, parameter table, example
- **Light/dark mode** — no-flash system preference + persisted header toggle
- **Responsive by composition** — sidebar → off-canvas drawer below 1024px,
TOC → collapsible panel below 1180px, header compacts below 640px
## Accessibility
Skip link, semantic landmarks (`header`/`main`/`nav`/`aside`/`article`), ARIA
on the search dialog, tablists, drawer, breadcrumbs, and TOC, `:focus-visible`
rings throughout, keyboard-operable controls (Escape closes overlays, Cmd/Ctrl+K
and `/` open search, arrow keys navigate results), and `prefers-reduced-motion`
guards on every animation.
## QA
Verified with Playwright across six viewport widths (320–1920px):
- **0 console errors** on every page and breakpoint
- **0 horizontal overflow** — `scrollWidth == clientWidth` at 320, 375, 768,
1024, 1280, and 1920px
- Strict HTML5 valid (html5lib), valid `metadata.json`
- Interactions pass: hash routing + active nav, scrollspy TOC, search open/close,
theme toggle, code copy buttons, code tabs, mobile drawer open/close
Zero runtime dependencies beyond Pico CSS and Google Fonts (both from CDN).
## Customizing
The whole template is data-driven from the top of the `<script>` block in
`preview.html`:
- `NAV` — sidebar structure (groups, items, nested children, badges)
- `META` — per-page eyebrow, title, last-updated date, edit-on-GitHub path
- `PAGES` — per-section content-builder functions
To add a section: add an entry to `NAV`, a row to `META`, and a `PAGES.<id>`
function. The router, TOC, search index, and prev/next pick it up automatically. # AGENTS.md — Documentation Site
Guidance for an AI agent adapting this template. Read this before editing.
## What this template is
A light-mode-first developer documentation template: 15 routed sections via hash routing, a nested sidebar, a scrollspy TOC, a Cmd+K search palette, tabbed code blocks with a lightweight syntax highlighter, and five callout variants. Modular files.
## Design system
Built on the shared [`design-tokens.md`](../design-tokens.md) `--ds-*` token system (1062 references, 81 unique tokens—the most token-saturated template). **Light is the default**; dark mode is opt-in (persisted, no-flash pre-paint script). Blue-600 accent—never violet/neon.
## File layout
```
Documentation Site/
├── pages/
│ ├── code.html # HTML structure (links style.css + script.js)
│ ├── style.css # the design system (--ds-* tokens)
│ └── script.js # router + content + scrollspy + search + code tools + theme
├── assets/ # logo.svg, favicon.svg
├── preview.html # self-contained preview (inlines CSS+JS)
├── metadata.json
└── README.md
```
All content lives in `script.js` (`NAV` config + `PAGES.<id>` content builders)—there are no per-page files. `preview.html` is `code.html` with `style.css` + `script.js` inlined.
## How to adapt it
1. **Change the docs content**: edit the `PAGES` object in `pages/script.js` (each page id maps to a content-builder function). The router and sidebar regenerate from `NAV`.
2. **Restructure navigation**: edit the `NAV` config in `pages/script.js` (groups + nested entries).
3. **Rebrand**: edit the `--ds-*` tokens in `pages/style.css` `:root`—keep blue-600 as the accent.
4. **Rebuild the preview**: after editing the modular files, regenerate `preview.html` by inlining `style.css` and `script.js` into `code.html`.
## Do not
- Do not introduce a framework. The router, search, and highlighter are deliberately vanilla.
- Do not move content out of `script.js` into separate page files—the hash router expects in-memory content builders.
- Do not darken the default theme. Light is the canonical docs experience.
## Quality bar
Reduced-motion guards on all animations, ARIA on the search dialog / tablists / drawer / TOC, `:focus-visible` rings, keyboard-operable (Esc, Cmd/Ctrl+K, `/`, arrows, Enter). Run `python3 scripts/qa/resources/qa_vanilla.py` after changes.
## Gotcha
`script.js` and the inlined `preview.html` script block contain example code strings with literal `<script>` tags—the closing `</script>` must be escaped as `<\/script>` in JS source or the HTML parser closes the real script block prematurely.