figma_scan_code_accessibility
Scan HTML code for accessibility violations using axe-core. Detects ARIA, labels, alt text, heading order, and semantic issues.
Instructions
Scan HTML code for accessibility violations using axe-core (Deque). Runs structural/semantic checks via JSDOM: ARIA attributes, roles, labels, alt text, form labels, heading order, landmarks, semantic HTML, tabindex, duplicate IDs, lang attribute, and ~50 more rules. Visual checks (color contrast, focus visibility) are disabled in this mode — use figma_lint_design for visual a11y on the design side. Also surfaces a WCAG 1.4.12 (Text Spacing) / 1.4.4 (Resize Text) advisory when typography is locked to fixed px units — the code side is where text-spacing override support is actually verified (a sub-1.5 line height in a design is not itself a failure). Together, these two tools provide full-spectrum accessibility coverage across design and code. Pass component HTML directly or use with figma_check_design_parity for design-to-code a11y comparison. No Figma connection required — this is a standalone code analysis tool.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| html | Yes | HTML string to scan. Can be a full document or a component fragment (will be wrapped in a valid document). | |
| tags | No | WCAG tag filter. Examples: ['wcag2a'], ['wcag2aa'], ['wcag21aa'], ['wcag22aa'], ['best-practice']. Defaults to all structural rules if omitted. | |
| context | No | CSS selector to scope the scan to a specific element (e.g., '#my-component', '.card'). Scans entire document if omitted. | |
| mapToCodeSpec | No | If true, includes a codeSpec.accessibility object auto-extracted from the HTML + scan results. Pass this directly into figma_check_design_parity's codeSpec.accessibility field for automated design-to-code a11y parity checking. | |
| includePassingRules | No | If true, includes count of passing and incomplete rules in the response (default: false). |