Accessibility#
md-book aims for WCAG 2.1 AA out of the box.
Built in#
- Landmark structure:
<header>,<nav>(labelled),<main>,<aside>,<footer>, plus a Skip to content link. - Focus moves to
<main>on every client-side navigation, and the page scrolls to the top (or the#hashtarget). - The sidebar marks the current page with
aria-current="page"; the TOC marks the active heading witharia-current="true". - The theme toggle is a real
<button>with anaria-labelandaria-pressed. prefers-reduced-motiondisables transitions.- Bundled themes meet AA contrast in light and dark.
Your responsibility#
- Give every image meaningful
alttext in your Markdown. - Keep heading levels sequential (don’t jump from
##to####). - If you supply a custom theme, re-check contrast for both modes.
- If you enable raw HTML (
allowHtml), you own its accessibility and safety.
Testing#
Run axe against a built page, and tab
through the site: every interactive element should have a visible focus ring
(md-book uses :focus-visible).