Accessibility
What Publier builds in for keyboard, screen reader, zoom and reduced-motion readers, what you must supply in your MDX, and where the framework's checks end.
Publier renders your content as static HTML and uses native elements (<details>, <a>, <ol>, <dialog>) wherever it can. This page lists what the framework already does, what only you can supply, and what nobody checks for you.
Page structure
The page title is the <h1>. On docs pages Publier renders the frontmatter title as the page’s <h1>, followed by description as a lead paragraph. Start your body at ## and do not add a second # Title.
Do not skip heading levels. Publier does not reorder or flag headings. W3C’s heading guidance says skipping heading ranks can be confusing and gives a <h2> followed directly by an <h4> as the example to avoid. Write headings in Markdown syntax (##, ###) so they appear in the page outline.
The outline is generated from your headings. The On this page list is a <nav> labelled “On this page”. It lists the headings of the page, indented by level, and marks the section currently in view with aria-current="location". A jump from ## to #### shows up as an indented entry with no parent.
Headings are links. Publier wraps each heading’s text in a link to its own anchor, so the heading text is also the link’s accessible name. Keep heading text unique and descriptive. To turn this off, set docsShell({ autolinkHeadings: false }) (see configuration).
Skip link and landmark. Docs pages start with a “Skip to content” link that is hidden until it receives keyboard focus and jumps to the <main> element. On a custom page, render the SkipLink component and set targetId to the id of your own <main>; the default is publier-main, which is not the id the docs layout uses.
Language. The base layout sets <html lang> to Astro’s currentLocale, which comes from your Astro i18n configuration, and falls back to en when there is none. A site in another language needs that configuration, or its pages declare English.
Page changes. The layout uses Astro’s client-side router. Astro announces the new page’s <title> to assistive technology after each navigation, so give every page a distinct title.
Images and media
Publier writes the alt you provide into the <img> unchanged and does not check it.
| Where | What you supply | What Publier does |
|---|---|---|
Markdown  | The alt text | Nothing beyond standard Markdown rendering. |
| ImageZoom, BlurImage | alt (required in the prop types) | Writes it to <img alt>. Images load lazily. |
| LogoCloud items | Optional alt | Falls back to the item’s name. |
| TeamGrid, TestimonialCard, PressGallery | Names | Generates the alt itself, as “name avatar” or “outlet logo”. |
- Describe what the image is for in its context, not what it looks like. For a purely decorative image, W3C’s decorative-images tutorial uses a null
alt="". - ImageZoom is pointer-only. Publier adds no
tabindex, role or key handler to the zoomable image, and the lightbox comes from themedium-zoomlibrary. Keyboard readers see the image at its normal size, so keep any text a reader needs in the page, not only in the zoomed view. - Diagrams. Publier does not add a text description to a rendered diagram. Say in the surrounding text what the diagram shows.
- Video. Frame renders a native
<video>fromsrc,poster,autoPlay,loop,mutedandtracks. Passtracksto attach captions, subtitles, descriptions or chapters as WebVTT files, each as{ src, srclang, label, kind?, default? }, and also supply a transcript on the page. The player always shows the browser’s controls, including withautoPlay, so a reader can pause it; still avoidautoPlayfor anything that matters.
Links and buttons
- Markdown links take their accessible name from the link text. Avoid “click here” and “read more”.
- External links open in a new tab. By default Publier adds
target="_blank"andrel="noopener noreferrer"to everyhttpandhttpsMarkdown link (configuration). It does not add a notice. If readers should know, put it in the link text, or setdocsShell({ externalLinks: false })to keep links in the same tab. - LinkCard: the card’s link contains only the
title, so the title is the accessible name; thedescriptionsits beside the link, not inside it. Give every card a distinct title. The whole card is clickable because the link stretches over it. LinkCard adds no “opens in new tab” notice when you passtarget="_blank". - LinkButton: a plain
<a>containing your slot content. Its only props arehref,variant,iconPlacement,rel,targetandclass, so there is noaria-labelprop. Give it visible text, and mark a decorative inline SVGaria-hidden="true", as the LinkButton examples do. <Icon>always renders its SVG witharia-hidden="true". Put the meaning in adjacent text.- Built-in icon-only controls are already named: the theme toggle (its label changes with the mode: auto, light, dark), the search button, the search dialog’s close button, and CopyButton (focusable, and its label changes to “Copied” after a copy). You do not need to relabel them.
Interactive components
What the framework provides, so you do not rebuild it.
| Component | Built in | You supply |
|---|---|---|
| Accordion, Expandable | Native <details> / <summary>: keyboard toggle and screen-reader state come from the browser. Accordion items sharing a name open one at a time. | A summary that says what is inside. |
| Tabs and CodeGroup | role="tablist", tab and tabpanel; aria-selected, aria-controls; only the active tab is in the tab order. Left/Right arrows move between tabs (wrapping), Home and End jump to the first and last. Inactive panels are hidden. | Distinct tab labels. |
| Callouts | An <aside> named by its title, or by the variant name (Note, Tip, Caution, Danger) when you give none. The icon is aria-hidden. | A title when the variant name alone is not enough. |
| Steps | An ordered list <ol>. | One list item per step. |
| FileTree | Nested lists with native <details> for folders. Folder rows start with visually hidden “Directory” text. The label prop becomes an aria-label on the wrapper. | A label that says which tree it is. |
| Tooltip | A CSS-only bubble: the text is in a data-tip attribute on a <span>. It shows on hover and when something inside the trigger has keyboard focus. | Anything a reader needs. See below. |
| Search | Ctrl/Cmd + K opens a native <dialog> and focuses the search input. | Nothing. |
| Open in AI, StatusIndicator | Roles and names are covered on their own pages. | — |
The mobile navigation menu and the section switcher are covered in global settings.
Colour and contrast
Publier does not check contrast. The theme engine checks the names of the settings in theme.yaml against an allow-list. It passes the values through unchanged, so a low-contrast pair of colours builds without a warning. This applies to your overrides and to custom CSS, which is also not validated.
What you do:
- Set the matching foreground for every fill you override:
primarywithprimary-content,accentwithaccent-content,base-100withbase-content. See theming. - When you override
primary, setlinktoo, and check it at 4.5:1 on every surface links sit on. See set the link colour. - Check each pair in light and in dark mode, including the status colours (
info,success,warning,error). - Do not rely on colour alone to carry meaning. Callouts pair colour with an icon and a label, and StatusIndicator pairs its dot with text; keep to that pattern in your own components.
- Check keyboard focus indicators against your backgrounds after any custom CSS.
ColorSwatch is the one place Publier does colour maths. It chooses dark or light label text from the WCAG relative luminance of the swatch, using a fixed threshold, and only for #hex and rgb() values. Any other format (such as oklch()) gets light text. Set textDark on an entry to override the choice and check the result.
Motion
Publier honours prefers-reduced-motion in most of its own animation:
| Honoured | Behaviour under reduce |
|---|---|
| ViewAnimation | Content appears immediately with no fade or slide. |
| BlurImage | The blur-in transition is removed. |
| Page transitions | Astro’s router disables its transition animations. |
| Top navigation menus | The open/close animation and chevron transition are removed. |
| Accordion chevrons | The chevron flips to its open position only when motion is allowed. |
| In-page links and On this page entries | The page jumps to the target instead of scrolling with animation. Readers without the setting keep smooth scrolling. |
One thing is not covered: small hover transitions, such as the colour and arrow movement on a LinkCard.
Text size
Pages follow the reader’s browser text size. The root font size is 100%, which is 16px at the browser default and larger for a reader who has chosen larger default text, so layouts look the same for most readers and scale for the rest. Setting --publier-font-size-root in your own CSS overrides this, and a fixed pixel value there stops the page following the reader, so prefer rem or %.
Where framework support ends
Publier does not check, and you or your theme owner must:
- Write meaningful alt text, link text and heading text.
- Keep heading levels in order and avoid a second
<h1>. - Check colour contrast, in both modes, for every colour you override.
- Provide captions, transcripts and descriptions for video and diagrams.
- Test third-party additions: analytics, embeds and chat widgets from integrations, and any custom component or custom CSS you write.
Before you publish, tab through a page with only the keyboard, zoom the browser to 200%, turn on your operating system’s reduced-motion setting, and read a page with a screen reader. Run an automated checker such as axe or Lighthouse, and treat a passing score as a floor, not proof that a page works for every reader.
Related
- Authoring basics → Content authoring and Markdown syntax.
- Component details → LinkButton, LinkCard, Tooltip, FileTree, Accordion.
- Colours and custom CSS → Theming.