Evaluating SSG Accessibility Defaults
Accessibility is usually treated as something a team adds after launch. In practice it is largely decided before launch, by the theme or starter the site is built on. The header markup, the sidebar's keyboard behaviour, the focus styles, the contrast of the code highlighting theme, the tab component for code samples — each is written once in a theme and repeated on every page. A good default gives a thousand accessible pages for free; a bad one produces a thousand issues that each cost a little to fix and are expensive to find.
This guide gives a two-hour evaluation procedure and applies it to the default themes of five options — Starlight, Docusaurus, VitePress, the Hugo Docsy theme and an Eleventy starter — on the same content. It adds the accessibility axis to the SSG Framework Selection Matrix.
Prerequisites
- Each candidate built with a representative sample of real content: a long guide, a reference page with tables, a page with tabbed code samples, the homepage and the 404 page.
- axe-core (via the browser extension,
@axe-core/clior Playwright), a keyboard and one screen reader (VoiceOver, NVDA or Orca). - About two hours per candidate.
Step 1: Automated Scan in Both Colour Schemes
Run axe-core against the five pages in light and dark mode. Dark themes are where contrast regressions hide, because they receive less testing.
// scripts/a11y-scan.mjs (Playwright + axe-core)
import { chromium } from 'playwright';
import AxeBuilder from '@axe-core/playwright';
const pages = ['/', '/guides/deploying/', '/reference/config/', '/guides/install/', '/nope/'];
const browser = await chromium.launch();
for (const scheme of ['light', 'dark']) {
const ctx = await browser.newContext({ colorScheme: scheme });
for (const p of pages) {
const page = await ctx.newPage();
await page.goto(`http://localhost:4321${p}`);
const { violations } = await new AxeBuilder({ page }).withTags(['wcag2a', 'wcag2aa']).analyze();
console.log(scheme, p, violations.map((v) => `${v.id}×${v.nodes.length}`).join(' '));
}
}
Step 2: Keyboard and Structure Pass
Automated tools miss what matters most for keyboard users. With the mouse put away, check on each page:
- The first Tab reveals a skip link that moves focus to the main content.
- Focus is always visible, with a style that meets contrast against the background.
- Sidebar sections expand and collapse with Enter/Space; the current page is announced.
- Code tabs follow the ARIA tabs pattern: arrow keys move between tabs, Tab moves into the panel.
- Copy buttons are reachable, labelled, and announce success.
- Scrollable code blocks are focusable (so keyboard users can scroll them) but do not trap focus.
- The search dialog traps focus while open, closes with Escape and returns focus to its trigger.
Step 3: A Quick Screen-Reader Pass
On one long guide, navigate by headings and by landmarks. Check that there is exactly one h1, headings do not skip levels, landmarks (banner, navigation, main, contentinfo) exist and navigation landmarks have distinct labels ("Main", "Sidebar", "On this page"). Listen to a code block and a table: tables need header cells; code blocks should not be announced as a stream of separate spans.
Results on Five Defaults
The five candidates with default themes and the same content. Automated counts are distinct axe rule violations across the ten page-and-scheme combinations; manual findings are failures of the seven keyboard checks and the structure checks.
| Default | axe violations (light / dark) | Keyboard checks failed (of 7) | Structure issues |
|---|---|---|---|
| Starlight | 0 / 0 | 0 | 0 |
| Docusaurus classic | 1 / 3 | 1 (code block scroll not focusable) | 0 |
| VitePress default | 0 / 2 | 1 (code group tabs lack arrow keys) | 1 (sidebar nav unlabelled) |
| Hugo Docsy | 3 / 6 | 2 (no skip link; focus style low contrast) | 1 (heading skip in sidebar) |
| Eleventy starter (base blog) | 2 / n/a (no dark mode) | 1 (no skip link) | 0 |
Every issue found was fixable, most in under an hour; the Docsy findings took about a day in total because two sat in shared partials used across many templates. The point of the evaluation is not to disqualify candidates but to price the fixes into the decision, and to know which ones must land before launch.
The Defaults That Matter Most
Across the five, the same few defaults decided most of the outcome. Skip link — missing in two of five, trivial to add, essential for keyboard users on pages with long sidebars. Focus visibility — present everywhere, but low-contrast in one theme's dark mode. Code block handling — scrollable <pre> elements must be keyboard-focusable (tabindex="0" with a label) so content wider than the column can be read; this is also a WCAG requirement that axe reports as scrollable-region-focusable. Code tabs — implemented as buttons in some themes, which works, and as a full ARIA tabs pattern in others, which works better. Dark-mode contrast — syntax highlighting themes are the usual culprit; comments rendered in dim grey often fall below 4.5:1.
Beyond the Theme: Content Patterns
A clean theme can still host inaccessible content, and some content problems originate in how the generator encourages authoring. Three patterns showed up across the sample content. Images added through Markdown without alternative text — the fix is a build check that fails on  with empty alt, with an explicit alt="" convention for decorative images. Diagrams delivered as images of text, which screen readers cannot read — inline SVG with a <title> and <desc>, or a text description next to the image, fixes it. And link text such as "here" or "this page" repeated many times on a page, which is meaningless when a screen-reader user lists links — a Vale rule flags it in pull requests, as described in Editorial Checks with Vale in CI. Each is a content guideline plus an automated check, which is cheaper than finding the same problem on hundreds of pages later.
Keep It Tested
A default is only a starting point; content and customisations change it. Add the Step 1 scan to CI against the preview deploy, failing on any new violation, and repeat the manual passes when the theme changes. On the Starlight site chosen after this evaluation, the CI scan caught two regressions in its first quarter: an SVG diagram with low-contrast labels in dark mode, and a new callout component whose icon was announced as "image" with no label.
Pitfalls & Rollback
- Testing the demo site. Evaluate with your own content; long tables and code samples expose issues demo pages do not.
- Light mode only. Test both colour schemes; dark mode had more violations in four of five themes.
- Treating a zero axe score as done. Keyboard and screen-reader checks find the issues that block tasks.
- Fixing in content instead of templates. A missing table header fixed page by page will return; fix the component.
- Ignoring reduced motion. Animated transitions and auto-playing demos should respect
prefers-reduced-motion; check it with the OS setting enabled. - Rollback: the evaluation changes nothing; the fixes it prompts are ordinary template changes.
Conclusion
Accessibility on a static site is inherited from its theme far more than it is added later. A two-hour evaluation per candidate — automated scans in both colour schemes, a keyboard pass through navigation and interactive components, and a short screen-reader pass — showed default-theme issue counts from 0 to 12 on identical content. Price the fixes into the choice, land the essential ones before launch, and keep the automated scan in CI so the default you chose stays a good one.
FAQ
Is accessibility a property of the generator or of the theme?
Mostly the theme and the content. Generators decide little about markup, but docs frameworks ship full themes, and starter templates set patterns that teams copy for years. Evaluate the theme or starter you would actually use.
Can automated tools find all accessibility problems?
No. Tools such as axe-core find roughly a third to a half of issues, reliably catching contrast, missing alternative text, empty links and ARIA misuse. Keyboard navigation, focus order, reading order and meaningful link text need manual checks.
Which defaults matter most on documentation sites?
A skip link, one h1 and a logical heading order, landmarks for navigation and main content, visible focus styles, sufficient contrast in both light and dark themes, keyboard-accessible code tabs and copy buttons, and code blocks that do not trap focus.
How long does an evaluation take?
About two hours per candidate: automated scans of five representative pages in both colour schemes, a keyboard-only pass through navigation and interactive components, and a quick screen-reader pass on one page.
Related
- Parent: SSG Framework Selection Matrix — accessibility alongside the other axes.
- Docs Frameworks: Docusaurus, Starlight and VitePress — three of the themes evaluated.
- Sidebar Navigation in Astro and Eleventy — building an accessible sidebar yourself.
- Visual Regression Testing on Preview Deploys — catching focus and contrast regressions visually.
- Total Cost of Ownership for Static Site Generators — pricing the fixes in.