Skip to main content

a11y

Guides accessibility review and implementation for FigUI3 web components and playground examples. Use when the user mentions accessibility, a11y, ARIA, screen readers, keyboard navigation, focus rings, labels, roles, disabled states, contrast, dialogs, menus, or form control semantics.

Informações da origem

Repositório
rogie/figui3
Última atividade na origem
6 de junho de 2026 às 19:34
Idioma detectado do SKILL.md
inglês
Estrelas
66
Forks
1

Opções de instalação

Por padrão, está selecionado o prompt que primeiro revisa a origem. Você pode mudar para um comando direto ou baixar uma cópia local.

Revise os arquivos de origem

Leia o SKILL.md e os arquivos complementares exibidos pelo SkillsMP antes de decidir se vai instalar.

Exibindo SKILL.md

SKILL.md
Instruções da origem · Visualização somente leitura
name
a11y
description
Guides accessibility review and implementation for FigUI3 web components and playground examples. Use when the user mentions accessibility, a11y, ARIA, screen readers, keyboard navigation, focus rings, labels, roles, disabled states, contrast, dialogs, menus, or form control semantics.
# Accessibility Use this skill when adding, reviewing, or debugging accessibility behavior in FigUI3. ## Core Principles 1. Preserve native semantics first. Use native controls, form labels, `button`, `input`, `dialog`, and real focus behavior where possible. 2. Add ARIA only to complete semantics, not to replace correct markup. 3. Keyboard support is required for every interactive component. 4. Disabled and readonly states must affect behavior, focusability, ARIA, visuals, and emitted events consistently. 5. Focus indicators must be visible, token-based, and match existing FigUI3 patterns. 6. Custom elements must keep semantics stable across light/dark themes and React usage. ## Implementation Checklist - Confirm the component role and accessible name. - Confirm keyboard entry, movement, activation, escape/cancel, and tab order. - Confirm focus rings on the visible interactive surface. - Confirm `disabled` syncs to `aria-disabled` where the element is not natively disableable. - Confirm disabled elements do not emit normal interaction changes. - Confirm `aria-*`, `role`, and `tabindex` are updated when attributes change dynamically. - Confirm customized built-ins like `<dialog is="fig-dialog">` and `<dialog is="fig-popup">` preserve native dialog behavior. - Confirm playground examples demonstrate accessible usage. ## FigUI3 Patterns ### Disabled custom elements For non-native interactive custom elements: ```js const disabled = this.hasAttribute("disabled") && this.getAttribute("disabled") !== "false"; if (disabled) { this.setAttribute("aria-disabled", "true"); this.setAttribute("tabindex", "-1"); } else { this.removeAttribute("aria-disabled"); this.setAttribute("tabindex", "0"); } ``` If a component uses roving tabindex, keep inactive and disabled items at `tabindex="-1"`. ### Focus rings Prefer existing token patterns: ```css &:focus-visible, &[data-focus-visible] { outline: 0; box-shadow: inset 0 0 0 1px var(--figma-color-border-selected); } ``` If focus lands on a hidden native input, apply the ring to the visible host surface: ```css fig-button:has(> input:focus-visible) { outline: 0; box-shadow: inset 0 0 0 1px var(--figma-color-border-selected); } ``` ### Menus - Menu popups use `role="menu"`. - Items use `role="menuitem"`. - Disabled menu items should have `aria-disabled="true"` and should not be included in roving keyboard focus. - Arrow keys should skip disabled items. ### Dialogs and popups - Use `<dialog is="fig-dialog">` for dialog workflows. - Use `<dialog is="fig-popup">` for anchored popup surfaces. - Verify close buttons have accessible names, usually `aria-label="Close dialog"`. - Preserve native `close`/`cancel` behavior unless intentionally overridden. ## Review Output When reviewing a11y work, lead with concrete issues: - Missing or incorrect role/name/state. - Keyboard trap or unreachable interaction. - Focus ring missing on visible surface. - Disabled state mismatch between behavior and semantics. - Screen reader announcement likely misleading. Include the component and file path for each finding.
Ver no GitHub