INNER CODE UNIT · TypeScript

checkAccessibility

hyscaler/HyCanvas · packages/a11y/src/index.ts:59

export function checkAccessibility(doc: DesignFile): A11yIssue[] {
  const issues: A11yIssue[] = [];
  // Slide titles (doc 28 FR-3/FR-29): every slide in a deck needs a name, or a
  // screen-reader user cannot navigate the presentation. Single-page designs
  // are not decks, so they are exempt.
  if (doc.pages.length > 1) {
    doc.pages.forEach((page, pageIndex) => {
      if (!page.name?.trim()) {
        issues.push({
          nodeId: page.id,
          nodeName: page.name,
          pageIndex,
          kind: "slide-title",
          severity: "warning",
          message: `Slide ${pageIndex + 1} has no title. Name the slide so screen readers can navigate the deck.`,
          messageCode: "a11y.slide_has_no_title",
          messageParams: { slide: pageIndex + 1 },
        });

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…