Skip to content
Halorav0.1.0

Getting started

Accessibility

Accessibility is a test in the repository, not a promise in the docs.

The contrast gate#

The token test computes WCAG contrast for every text and background pair that the components use, in both themes and both brands. Translucent surfaces are composited over the canvas first. The build fails below 4.5:1 for text, and below 3:1 for large text and the focus ring.

PairMinimumUsed for
text, muted, faint on canvas, surface, glass, raised4.5:1Body copy, secondary copy, captions
accent-text on canvas, surface, glass4.5:1Links, eyebrows, stat numbers
on-accent on accent-fill and accent-fill-hover4.5:1Primary buttons, active pills, badges
danger, success on canvas and surface4.5:1Status text
code tokens on code-bg4.5:1Syntax highlighting
hl-from, hl-to on canvas3:1Large gradient headings
focus-ring on canvas, surface, surface-23:1Keyboard focus outline

The Tokens page recomputes these ratios in your browser, so you can see them change with the theme.

Built in behavior#

  • Focus. :focus-visible draws a 2px outline from the focus-ring token with a 3px offset. Interactive cards use :focus-within.
  • Reduced motion. prefers-reduced-motion: reduce and the pause switch turn off CSS animation and transitions, show all revealed content, and stop particles.
  • Touch targets. Controls are at least 40px on desktop and 44px on phones.
  • Text size. Body copy is 16px or more, labels are 13px or more at weight 500, and the article measure is 68ch.
  • Skip link and landmarks. .ha-skip-link and .ha-visually-hidden are in the base layer.
  • Native elements. Dialogs use <dialog>, so focus trapping, Escape, and inertness of the page come from the browser.

Your part#

CSS cannot make a page accessible by itself. These are the things the markup has to do.

Do

  • Use real <button> and <a> elements for controls.
  • Keep one <h1> per page and a logical heading order.
  • Give icon-only buttons an aria-label that names the action.
  • Hide decorative glows and particles from assistive technology with aria-hidden="true".
  • Set aria-pressed on toggle buttons and aria-current on the active item.

Don't

  • Use accent or accent-light as a text color. They are for decoration.
  • Put faint on body copy. It is for captions and metadata.
  • Convey state by color alone.
  • Autoplay moving content without a pause control placed at least 24px from what it controls.
  • Remove the focus outline without replacing it.

Automated checks#

The repository runs axe-core through Playwright on the landing page and the documentation pages, in both themes, on every CI run. Axe catches roughly a third of issues. Keyboard and screen reader checks still matter.

Terminal
npm run build:all
npm run a11y

Edit this page on GitHub

Type to search.