[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6D1XVNVMS7DZ3MCFKRGA78Y":3,"skill-same:01M6D1XVNVMS7DZ3MCFKRGA78Y":67},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":39,"linkOnly":40,"markdownContent":41,"markdownBody":42,"frontMatter":43,"refName":44,"commitSha":45,"skillDirectory":46,"forksCount":47,"repositoryHtmlUrl":48,"repositoryHomepageUrl":49,"ownerHtmlUrl":50,"ownerBlogUrl":49,"ownerDescription":51,"updatedAt":52,"install":53,"resources":66},"01M6D1XVNVMS7DZ3MCFKRGA78Y","frontend-accessibility",null,"Accessibility in code: semantic HTML first, the ARIA patterns for custom widgets, keyboard and focus management, accessible names, live regions, forms, media, colour, zoom and motion, and testing with axe, a keyboard and a screen reader. Read before building any interactive component, and before calling a page done.","enowdev\u002Fenowxcli","enowdev","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F179420349?v=4","01M6D1MVX2KC0X3Z9NESE7P22K","Enow Dev.","01M6D1MW1FMZGBDKWAJY4GQX81",67,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fenowdev\u002Fenowxcli\u002Fblob\u002Fmain\u002Fcrates\u002Fenowx-core\u002Fskills\u002Ffrontend-accessibility\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38],"frontend","frontend accessibility","accessibility","interactive","testing","widgets","focus","done","forms","calling","aria","motion","read","before building","reader","page","Media","first","code","component","2026-11-10 10:12:30",false,"---\nname: frontend-accessibility\ndescription: \"Accessibility in code: semantic HTML first, the ARIA patterns for custom widgets, keyboard and focus management, accessible names, live regions, forms, media, colour, zoom and motion, and testing with axe, a keyboard and a screen reader. Read before building any interactive component, and before calling a page done.\"\n---\n\n# Accessibility in code\n\nThe generated interface is built from `div`s with click handlers, icon\nbuttons with no name, a dropdown that opens on click but never from the\nkeyboard, a dialog that lets focus wander behind it, `outline: none`\neverywhere, and ARIA attributes sprinkled where they change nothing or\nmake things worse. It passes a glance and fails the first keyboard or\nscreen reader user. This is the code that makes an interface work for\neveryone: native elements first, the ARIA patterns where a custom widget\nis needed, focus handled on purpose, and a pass by hand. The visual rules\nare in `ui`; the whole frontend in `frontend`.\n\n## 1. The bar\n\n- WCAG 2.2 level AA on every screen. It is also what the law points to in\n  many places: the European Accessibility Act applies to many products and\n  services sold in the EU from 28 June 2025, through EN 301 549.\n- New in 2.2 and often missed: focus not hidden behind sticky bars\n  (2.4.11), a single-pointer alternative to dragging (2.5.7), targets of at\n  least 24 by 24px (2.5.8), help in the same place on every page (3.2.6),\n  nothing asked twice (3.3.7), and sign-in without a memory or puzzle test,\n  with paste and password managers allowed (3.3.8).\n- The WebAIM Million survey of home pages finds the same failures every\n  year: low-contrast text, images without alt text, fields without labels,\n  empty links, empty buttons, no page language. All six are cheap to\n  prevent.\n\n## 2. Semantic HTML first\n\n| Need | Use | Not |\n|---|---|---|\n| An action | `\u003Cbutton type=\"button\">` | `\u003Cdiv onClick>`, `\u003Ca href=\"#\">` |\n| Going somewhere | `\u003Ca href=\"\u002Forders\">` | a button that calls `navigate()` |\n| Regions | `header`, `nav`, `main` (one), `aside`, `footer` | `div`s with class names |\n| Structure | one `h1`, then `h2` and `h3` in order | headings chosen for their size |\n| Lists and data | `ul`, `ol`, `dl`; `table` with `th scope` and a `caption` | a `div` per item or cell |\n| Show and hide | `details` and `summary`, or a button with `aria-expanded` | a clickable heading |\n| A modal | `dialog` opened with `showModal()` | a `div` over a scrim |\n\n- A `\u003Cdiv onClick>` lacks focus, Enter and Space, a role, a disabled state\n  and form submission; adding them back (`role`, `tabIndex`, key handlers)\n  is more code than the `button` it imitates.\n- The first rule of ARIA: when a native element does the job, use it. No\n  ARIA is better than wrong ARIA, and pages with ARIA average more errors\n  than pages without. ARIA changes what is announced, never behaviour: a\n  `role=\"button\"` still needs its keys.\n- Several `nav`s are told apart with `aria-label` (\"Primary\",\n  \"Breadcrumb\"). Never `aria-hidden=\"true\"` on anything focusable or its\n  parent.\n\n## 3. Names and descriptions\n\n- Every control has an accessible name: its visible label (`\u003Clabel>`,\n  button text), else `aria-labelledby` pointing at visible text, else\n  `aria-label`. A `title` is not a label.\n- Icon-only buttons: `aria-label=\"Delete invoice\"`, or visually hidden\n  text. Repeated actions name their object: twenty \"Edit\" buttons become\n  \"Edit INV-204\".\n- The visible label starts the accessible name, so voice control (\"click\n  Send\") works (2.5.3).\n- Hints and errors are descriptions, tied with `aria-describedby`.\n- Alt text by the image's job:\n\n| Image | `alt` |\n|---|---|\n| Carries content (a photo that matters, a simple chart) | what it shows that matters here, in a sentence |\n| Inside a link or button | where it goes or what it does (\"Home\", \"Search\") |\n| Decorative, or repeated by the text beside it | `alt=\"\"` |\n| Complex (a diagram, a detailed chart) | a short `alt`, the full description in the text or a `figcaption` |\n| An image of text | the text |\n| A logo | the organisation's name |\n\n- Never \"image of\", never a file name; with no `alt` at all, screen\n  readers read the file name. Decorative SVGs get `aria-hidden=\"true\"`; a\n  meaningful one gets `role=\"img\"` and `aria-label`.\n- Text hidden on screen but read aloud:\n\n```css\n.sr-only {\n  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;\n  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;\n}\n```\n\n## 4. Keyboard\n\n- Everything a pointer can do, a keyboard can: Tab and Shift+Tab move\n  between controls in DOM order; Enter activates links and buttons; Space\n  activates buttons, checkboxes and switches.\n- DOM order is visual order: CSS `order`, grid placement and absolute\n  positioning never make focus jump around the screen.\n- A composite widget (tabs, menu, listbox, radio group, toolbar, grid) is\n  one tab stop, with arrow keys inside: a roving `tabindex` (`0` on the\n  current item, `-1` on the rest) or `aria-activedescendant`.\n- Escape closes the top layer: a menu, popover, dialog or drawer.\n- No traps: focus can always leave a component (a modal keeps it on\n  purpose, and Escape leaves).\n- `tabindex` above 0: never. `tabindex=\"-1\"` only on elements focused from\n  code (a heading after navigation, an error summary).\n- What shows on hover also shows on focus, stays while the pointer moves\n  onto it, and hides with Escape (1.4.13).\n- Dragging (reordering, sliders, maps) has a click or key alternative:\n  \"Move up\" and \"Move down\", arrow keys (2.5.7).\n- Single-key shortcuts can be turned off or remapped (2.1.4), and never\n  take keys that screen readers and browsers use.\n\n## 5. Focus management\n\n- A visible focus style on every control, never removed without a\n  replacement: an outline (it survives Windows forced colours, where\n  shadows vanish), at least 2px, with 3:1 contrast against its\n  surroundings:\n\n```css\n:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }\n```\n\n- Dialogs and drawers: focus moves in on open (to the first field, or the\n  dialog when it opens with text to read), stays inside (`showModal()`\n  makes the rest inert; otherwise `inert` on the background), and returns\n  to the opener on close. If the opener is gone (its row was deleted), to\n  the next row or the list's heading.\n- Client-side route changes are announced and focus starts from the new\n  page. Next.js and SvelteKit announce the new page themselves; with a\n  router that does not, move focus to the new `h1` (with `tabIndex={-1}`)\n  after every navigation but the first. Keep `document.title` current.\n- A skip link as the first focusable element, visible on focus:\n  `\u003Ca href=\"#main\" class=\"skip-link\">Skip to content\u003C\u002Fa>`, with\n  `\u003Cmain id=\"main\" tabindex=\"-1\">`.\n- Sticky bars never cover the focused element: `scroll-padding-top` (and\n  bottom) on the scroller, the bar's height plus 8 to 16px (2.4.11).\n- When an action removes what had focus (a deleted item, a finished step),\n  put focus somewhere meaningful, never on `document.body`. Content that\n  loads never steals focus; it is announced (section 7).\n\n## 6. Custom widgets: the APG patterns\n\nTake a tested implementation before writing one: Radix Primitives, React\nAria, Headless UI, Ark UI, Base UI, Reka UI (Vue), Bits UI and Melt UI\n(Svelte), Angular CDK, or the project's library built on one (`ui`). When\nyou must build one, follow the WAI-ARIA Authoring Practices pattern:\n\n| Widget | Roles and states | Keys |\n|---|---|---|\n| Modal dialog | `dialog`, or `role=\"dialog\"` with `aria-modal=\"true\"`; `aria-labelledby` its title | Tab cycles inside; Escape closes; focus returns |\n| Disclosure | `button` with `aria-expanded`, `aria-controls` | Enter and Space toggle |\n| Accordion | each header a `button` inside a heading, with `aria-expanded` | Enter, Space; optional Up, Down, Home, End between headers |\n| Tabs | `tablist`; `tab` with `aria-selected`, `aria-controls`; `tabpanel` | Left and Right move (and select, unless manual); Home, End; Tab enters the panel |\n| Menu button | `button` with `aria-haspopup=\"menu\"`, `aria-expanded`; `menu`, `menuitem` | Enter, Space or Down open on the first item, Up on the last; arrows, Home, End, type-ahead; Escape closes and returns focus; Tab closes |\n| Listbox | `listbox`; `option` with `aria-selected` | Up, Down, Home, End, type-ahead; Space toggles in multi-select |\n| Combobox | input with `role=\"combobox\"`, `aria-expanded`, `aria-controls`, `aria-activedescendant` | Down opens and moves; Enter picks; Escape closes, then clears; Alt+Down opens |\n| Tooltip | `role=\"tooltip\"`, referenced by `aria-describedby` | shows on hover and focus; Escape hides |\n| Switch | `button` with `role=\"switch\"`, `aria-checked` | Space toggles (Enter too, on a button) |\n| Slider | `input type=\"range\"`, or `slider` with `aria-valuenow`, min, max, `aria-valuetext` | arrows by a step; Page Up and Down by more; Home, End |\n| Radio group | native radios in a `fieldset` | arrows move and select; one tab stop |\n| Grid | `grid`, `row`, `gridcell`, only when cells are interactive | arrows between cells; Home, End; Ctrl+Home, Ctrl+End; one tab stop |\n| Carousel | each slide a labelled group (\"3 of 5\"); previous, next, pause | rotation stops on hover and focus |\n\n- A `menu` is for application commands. Site navigation with sub-pages is a\n  disclosure holding links, not a menu.\n- Native first again: `\u003Cinput type=\"range\">` before a custom slider, `\u003Cdetails>` before a hand-made\n  disclosure. A table people only read is a `table`, not a `grid`. The\n  exception is the dropdown: the native `select` renders differently on\n  every OS, so it is a custom listbox built to the APG select pattern\n  (`ui-part-choices`, section 7) or the stack's accessible component.\n- Tooltips hold no links or buttons (use a popover or dialog), and are\n  never the only place a control's name lives.\n\n## 7. Live regions\n\n- Changes the user did not move to are announced from a live region that\n  is in the DOM before its text changes; a region inserted together with\n  its text is often not read.\n- `role=\"status\"` (polite) for results counts (\"24 invoices match\"),\n  \"Saved\", toasts and loads finishing; `role=\"alert\"` (assertive) only for\n  errors that need attention now.\n- Short messages, one at a time; debounce them while someone types. Toast\n  libraries (Sonner and the like) set this up; check they announce.\n\n```tsx\n\u002F\u002F Always mounted; only its text changes\n\u003Cp role=\"status\" className=\"sr-only\">{resultsMessage}\u003C\u002Fp>\n```\n\n## 8. Forms, media, colour and zoom\n\n- **Forms**: a label on every field, `fieldset` and `legend` for groups,\n  errors tied with `aria-describedby` and `aria-invalid`, required shown\n  in text, `autocomplete` tokens (1.3.5), paste allowed in passwords and\n  codes (3.3.8), nothing asked twice (\"Same as billing address\", 3.3.7).\n  The behaviour is `frontend-forms`.\n- **Media**: captions on video with speech (`\u003Ctrack kind=\"captions\">`), a\n  transcript for audio, a description of what the picture shows that the\n  sound does not; no autoplay with sound; a pause for anything that moves\n  by itself for more than 5 seconds (2.2.2); nothing flashing more than 3\n  times a second (2.3.1).\n- **Contrast**: 4.5:1 for text, 3:1 for large text (24px, or 18.66px\n  bold), 3:1 for control edges and states, meaningful icons, focus\n  indicators and chart marks; measured in both themes (`ui`, `ui-themes`).\n- **Not colour alone**: links in running text are underlined; errors,\n  statuses and chart series carry text, an icon or a pattern.\n- **Zoom and reflow**: at 320px wide (1280px at 400%) nothing needs\n  scrolling in two directions except tables and maps; text at 200% still\n  fits; a reader's text spacing (line height 1.5, letter spacing 0.12em)\n  breaks nothing, so no fixed heights on text (1.4.10, 1.4.4, 1.4.12).\n  Font sizes in `rem`; never `maximum-scale=1` or `user-scalable=no`.\n- **Targets**: at least 24 by 24px with spacing (2.5.8), 44px on touch\n  screens (`ui-layout`).\n- **Forced colours** (`@media (forced-colors: active)`): borders and\n  outlines stay, backgrounds and shadows go; icons use `currentColor`, and\n  no state is only a background colour.\n- **Motion**: reduced motion and flashing are `motion-comfort`.\n- **Language and titles**: `\u003Chtml lang>` set from the active locale\n  (`i18n`), `lang` on phrases in another language, `dir=\"rtl\"` for Arabic\n  and Hebrew with logical properties (`margin-inline-start`, `text-align:\n  start`); a unique `\u003Ctitle>` per page, the page first, then the product.\n\n## 9. Testing\n\n- Lint: `eslint-plugin-jsx-a11y`, `eslint-plugin-vuejs-accessibility`,\n  Svelte's compiler warnings (never silenced), the `@angular-eslint\u002Ftemplate`\n  accessibility rules.\n- Component tests query by role and name (`getByRole(\"button\", { name:\n  \"Save\" })`): a control a test cannot find that way is a bug. Add\n  vitest-axe or jest-axe; jsdom has no layout, so contrast is not checked\n  there (`frontend-testing`).\n- End-to-end: `@axe-core\u002Fplaywright` on each key screen and state (a\n  dialog open, errors shown):\n\n```ts\nconst results = await new AxeBuilder({ page })\n  .withTags([\"wcag2a\", \"wcag2aa\", \"wcag21a\", \"wcag21aa\", \"wcag22aa\"])\n  .analyze();\nexpect(results.violations).toEqual([]);\n```\n\n- By hand, every time, because tools find only part of the problems: not\n  whether alt text is right, focus order makes sense, announcements happen\n  or a custom widget works.\n  - Keyboard: put the mouse away and do the task. Focus always visible,\n    order logical, nothing unreachable, Escape closes, focus returns.\n  - Zoom to 200%, and a 320px wide window: nothing lost or overlapping.\n  - A screen reader for 5 minutes: VoiceOver on macOS (Cmd+F5; VO+U opens\n    the rotor with headings, links, landmarks and form controls) or NVDA\n    with Firefox or Chrome on Windows (H headings, D landmarks, F form\n    fields). Do the main task; listen for names, states, announcements.\n- Chrome DevTools, Elements, Accessibility pane: each element's computed\n  role and name.\n\n## Check it\n\n- `preview` at 360, 768 and 1440px and in the second theme: text below AA\n  contrast, icons below 3:1, images without alt, controls without a name,\n  touch targets under 44px, the number of `h1`s.\n- `ui_check`: removed focus styles, images without alt, dead controls;\n  `grep -rnE \"\u003C(div|span)[^>]*onClick\" src` for clickable `div`s.\n- axe clean in component and end-to-end tests; the keyboard and screen\n  reader passes above on the screens you built.\n\n## Avoid\n\nClickable `div`s and `href=\"#\"` buttons; icon buttons with no name;\n`outline: none` with nothing in its place; ARIA roles without the keys\nthey promise; `role=\"menu\"` for site navigation; `tabindex` above 0;\ndialogs that let focus escape or never return it; focus lost to the body\nafter a route change or a delete; live regions inserted with their text;\nplaceholder-only fields; colour as the only signal; zoom disabled; a page\ncalled done without a keyboard pass.\n","# Accessibility in code\n\nThe generated interface is built from `div`s with click handlers, icon\nbuttons with no name, a dropdown that opens on click but never from the\nkeyboard, a dialog that lets focus wander behind it, `outline: none`\neverywhere, and ARIA attributes sprinkled where they change nothing or\nmake things worse. It passes a glance and fails the first keyboard or\nscreen reader user. This is the code that makes an interface work for\neveryone: native elements first, the ARIA patterns where a custom widget\nis needed, focus handled on purpose, and a pass by hand. The visual rules\nare in `ui`; the whole frontend in `frontend`.\n\n## 1. The bar\n\n- WCAG 2.2 level AA on every screen. It is also what the law points to in\n  many places: the European Accessibility Act applies to many products and\n  services sold in the EU from 28 June 2025, through EN 301 549.\n- New in 2.2 and often missed: focus not hidden behind sticky bars\n  (2.4.11), a single-pointer alternative to dragging (2.5.7), targets of at\n  least 24 by 24px (2.5.8), help in the same place on every page (3.2.6),\n  nothing asked twice (3.3.7), and sign-in without a memory or puzzle test,\n  with paste and password managers allowed (3.3.8).\n- The WebAIM Million survey of home pages finds the same failures every\n  year: low-contrast text, images without alt text, fields without labels,\n  empty links, empty buttons, no page language. All six are cheap to\n  prevent.\n\n## 2. Semantic HTML first\n\n| Need | Use | Not |\n|---|---|---|\n| An action | `\u003Cbutton type=\"button\">` | `\u003Cdiv onClick>`, `\u003Ca href=\"#\">` |\n| Going somewhere | `\u003Ca href=\"\u002Forders\">` | a button that calls `navigate()` |\n| Regions | `header`, `nav`, `main` (one), `aside`, `footer` | `div`s with class names |\n| Structure | one `h1`, then `h2` and `h3` in order | headings chosen for their size |\n| Lists and data | `ul`, `ol`, `dl`; `table` with `th scope` and a `caption` | a `div` per item or cell |\n| Show and hide | `details` and `summary`, or a button with `aria-expanded` | a clickable heading |\n| A modal | `dialog` opened with `showModal()` | a `div` over a scrim |\n\n- A `\u003Cdiv onClick>` lacks focus, Enter and Space, a role, a disabled state\n  and form submission; adding them back (`role`, `tabIndex`, key handlers)\n  is more code than the `button` it imitates.\n- The first rule of ARIA: when a native element does the job, use it. No\n  ARIA is better than wrong ARIA, and pages with ARIA average more errors\n  than pages without. ARIA changes what is announced, never behaviour: a\n  `role=\"button\"` still needs its keys.\n- Several `nav`s are told apart with `aria-label` (\"Primary\",\n  \"Breadcrumb\"). Never `aria-hidden=\"true\"` on anything focusable or its\n  parent.\n\n## 3. Names and descriptions\n\n- Every control has an accessible name: its visible label (`\u003Clabel>`,\n  button text), else `aria-labelledby` pointing at visible text, else\n  `aria-label`. A `title` is not a label.\n- Icon-only buttons: `aria-label=\"Delete invoice\"`, or visually hidden\n  text. Repeated actions name their object: twenty \"Edit\" buttons become\n  \"Edit INV-204\".\n- The visible label starts the accessible name, so voice control (\"click\n  Send\") works (2.5.3).\n- Hints and errors are descriptions, tied with `aria-describedby`.\n- Alt text by the image's job:\n\n| Image | `alt` |\n|---|---|\n| Carries content (a photo that matters, a simple chart) | what it shows that matters here, in a sentence |\n| Inside a link or button | where it goes or what it does (\"Home\", \"Search\") |\n| Decorative, or repeated by the text beside it | `alt=\"\"` |\n| Complex (a diagram, a detailed chart) | a short `alt`, the full description in the text or a `figcaption` |\n| An image of text | the text |\n| A logo | the organisation's name |\n\n- Never \"image of\", never a file name; with no `alt` at all, screen\n  readers read the file name. Decorative SVGs get `aria-hidden=\"true\"`; a\n  meaningful one gets `role=\"img\"` and `aria-label`.\n- Text hidden on screen but read aloud:\n\n```css\n.sr-only {\n  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;\n  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;\n}\n```\n\n## 4. Keyboard\n\n- Everything a pointer can do, a keyboard can: Tab and Shift+Tab move\n  between controls in DOM order; Enter activates links and buttons; Space\n  activates buttons, checkboxes and switches.\n- DOM order is visual order: CSS `order`, grid placement and absolute\n  positioning never make focus jump around the screen.\n- A composite widget (tabs, menu, listbox, radio group, toolbar, grid) is\n  one tab stop, with arrow keys inside: a roving `tabindex` (`0` on the\n  current item, `-1` on the rest) or `aria-activedescendant`.\n- Escape closes the top layer: a menu, popover, dialog or drawer.\n- No traps: focus can always leave a component (a modal keeps it on\n  purpose, and Escape leaves).\n- `tabindex` above 0: never. `tabindex=\"-1\"` only on elements focused from\n  code (a heading after navigation, an error summary).\n- What shows on hover also shows on focus, stays while the pointer moves\n  onto it, and hides with Escape (1.4.13).\n- Dragging (reordering, sliders, maps) has a click or key alternative:\n  \"Move up\" and \"Move down\", arrow keys (2.5.7).\n- Single-key shortcuts can be turned off or remapped (2.1.4), and never\n  take keys that screen readers and browsers use.\n\n## 5. Focus management\n\n- A visible focus style on every control, never removed without a\n  replacement: an outline (it survives Windows forced colours, where\n  shadows vanish), at least 2px, with 3:1 contrast against its\n  surroundings:\n\n```css\n:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }\n```\n\n- Dialogs and drawers: focus moves in on open (to the first field, or the\n  dialog when it opens with text to read), stays inside (`showModal()`\n  makes the rest inert; otherwise `inert` on the background), and returns\n  to the opener on close. If the opener is gone (its row was deleted), to\n  the next row or the list's heading.\n- Client-side route changes are announced and focus starts from the new\n  page. Next.js and SvelteKit announce the new page themselves; with a\n  router that does not, move focus to the new `h1` (with `tabIndex={-1}`)\n  after every navigation but the first. Keep `document.title` current.\n- A skip link as the first focusable element, visible on focus:\n  `\u003Ca href=\"#main\" class=\"skip-link\">Skip to content\u003C\u002Fa>`, with\n  `\u003Cmain id=\"main\" tabindex=\"-1\">`.\n- Sticky bars never cover the focused element: `scroll-padding-top` (and\n  bottom) on the scroller, the bar's height plus 8 to 16px (2.4.11).\n- When an action removes what had focus (a deleted item, a finished step),\n  put focus somewhere meaningful, never on `document.body`. Content that\n  loads never steals focus; it is announced (section 7).\n\n## 6. Custom widgets: the APG patterns\n\nTake a tested implementation before writing one: Radix Primitives, React\nAria, Headless UI, Ark UI, Base UI, Reka UI (Vue), Bits UI and Melt UI\n(Svelte), Angular CDK, or the project's library built on one (`ui`). When\nyou must build one, follow the WAI-ARIA Authoring Practices pattern:\n\n| Widget | Roles and states | Keys |\n|---|---|---|\n| Modal dialog | `dialog`, or `role=\"dialog\"` with `aria-modal=\"true\"`; `aria-labelledby` its title | Tab cycles inside; Escape closes; focus returns |\n| Disclosure | `button` with `aria-expanded`, `aria-controls` | Enter and Space toggle |\n| Accordion | each header a `button` inside a heading, with `aria-expanded` | Enter, Space; optional Up, Down, Home, End between headers |\n| Tabs | `tablist`; `tab` with `aria-selected`, `aria-controls`; `tabpanel` | Left and Right move (and select, unless manual); Home, End; Tab enters the panel |\n| Menu button | `button` with `aria-haspopup=\"menu\"`, `aria-expanded`; `menu`, `menuitem` | Enter, Space or Down open on the first item, Up on the last; arrows, Home, End, type-ahead; Escape closes and returns focus; Tab closes |\n| Listbox | `listbox`; `option` with `aria-selected` | Up, Down, Home, End, type-ahead; Space toggles in multi-select |\n| Combobox | input with `role=\"combobox\"`, `aria-expanded`, `aria-controls`, `aria-activedescendant` | Down opens and moves; Enter picks; Escape closes, then clears; Alt+Down opens |\n| Tooltip | `role=\"tooltip\"`, referenced by `aria-describedby` | shows on hover and focus; Escape hides |\n| Switch | `button` with `role=\"switch\"`, `aria-checked` | Space toggles (Enter too, on a button) |\n| Slider | `input type=\"range\"`, or `slider` with `aria-valuenow`, min, max, `aria-valuetext` | arrows by a step; Page Up and Down by more; Home, End |\n| Radio group | native radios in a `fieldset` | arrows move and select; one tab stop |\n| Grid | `grid`, `row`, `gridcell`, only when cells are interactive | arrows between cells; Home, End; Ctrl+Home, Ctrl+End; one tab stop |\n| Carousel | each slide a labelled group (\"3 of 5\"); previous, next, pause | rotation stops on hover and focus |\n\n- A `menu` is for application commands. Site navigation with sub-pages is a\n  disclosure holding links, not a menu.\n- Native first again: `\u003Cinput type=\"range\">` before a custom slider, `\u003Cdetails>` before a hand-made\n  disclosure. A table people only read is a `table`, not a `grid`. The\n  exception is the dropdown: the native `select` renders differently on\n  every OS, so it is a custom listbox built to the APG select pattern\n  (`ui-part-choices`, section 7) or the stack's accessible component.\n- Tooltips hold no links or buttons (use a popover or dialog), and are\n  never the only place a control's name lives.\n\n## 7. Live regions\n\n- Changes the user did not move to are announced from a live region that\n  is in the DOM before its text changes; a region inserted together with\n  its text is often not read.\n- `role=\"status\"` (polite) for results counts (\"24 invoices match\"),\n  \"Saved\", toasts and loads finishing; `role=\"alert\"` (assertive) only for\n  errors that need attention now.\n- Short messages, one at a time; debounce them while someone types. Toast\n  libraries (Sonner and the like) set this up; check they announce.\n\n```tsx\n\u002F\u002F Always mounted; only its text changes\n\u003Cp role=\"status\" className=\"sr-only\">{resultsMessage}\u003C\u002Fp>\n```\n\n## 8. Forms, media, colour and zoom\n\n- **Forms**: a label on every field, `fieldset` and `legend` for groups,\n  errors tied with `aria-describedby` and `aria-invalid`, required shown\n  in text, `autocomplete` tokens (1.3.5), paste allowed in passwords and\n  codes (3.3.8), nothing asked twice (\"Same as billing address\", 3.3.7).\n  The behaviour is `frontend-forms`.\n- **Media**: captions on video with speech (`\u003Ctrack kind=\"captions\">`), a\n  transcript for audio, a description of what the picture shows that the\n  sound does not; no autoplay with sound; a pause for anything that moves\n  by itself for more than 5 seconds (2.2.2); nothing flashing more than 3\n  times a second (2.3.1).\n- **Contrast**: 4.5:1 for text, 3:1 for large text (24px, or 18.66px\n  bold), 3:1 for control edges and states, meaningful icons, focus\n  indicators and chart marks; measured in both themes (`ui`, `ui-themes`).\n- **Not colour alone**: links in running text are underlined; errors,\n  statuses and chart series carry text, an icon or a pattern.\n- **Zoom and reflow**: at 320px wide (1280px at 400%) nothing needs\n  scrolling in two directions except tables and maps; text at 200% still\n  fits; a reader's text spacing (line height 1.5, letter spacing 0.12em)\n  breaks nothing, so no fixed heights on text (1.4.10, 1.4.4, 1.4.12).\n  Font sizes in `rem`; never `maximum-scale=1` or `user-scalable=no`.\n- **Targets**: at least 24 by 24px with spacing (2.5.8), 44px on touch\n  screens (`ui-layout`).\n- **Forced colours** (`@media (forced-colors: active)`): borders and\n  outlines stay, backgrounds and shadows go; icons use `currentColor`, and\n  no state is only a background colour.\n- **Motion**: reduced motion and flashing are `motion-comfort`.\n- **Language and titles**: `\u003Chtml lang>` set from the active locale\n  (`i18n`), `lang` on phrases in another language, `dir=\"rtl\"` for Arabic\n  and Hebrew with logical properties (`margin-inline-start`, `text-align:\n  start`); a unique `\u003Ctitle>` per page, the page first, then the product.\n\n## 9. Testing\n\n- Lint: `eslint-plugin-jsx-a11y`, `eslint-plugin-vuejs-accessibility`,\n  Svelte's compiler warnings (never silenced), the `@angular-eslint\u002Ftemplate`\n  accessibility rules.\n- Component tests query by role and name (`getByRole(\"button\", { name:\n  \"Save\" })`): a control a test cannot find that way is a bug. Add\n  vitest-axe or jest-axe; jsdom has no layout, so contrast is not checked\n  there (`frontend-testing`).\n- End-to-end: `@axe-core\u002Fplaywright` on each key screen and state (a\n  dialog open, errors shown):\n\n```ts\nconst results = await new AxeBuilder({ page })\n  .withTags([\"wcag2a\", \"wcag2aa\", \"wcag21a\", \"wcag21aa\", \"wcag22aa\"])\n  .analyze();\nexpect(results.violations).toEqual([]);\n```\n\n- By hand, every time, because tools find only part of the problems: not\n  whether alt text is right, focus order makes sense, announcements happen\n  or a custom widget works.\n  - Keyboard: put the mouse away and do the task. Focus always visible,\n    order logical, nothing unreachable, Escape closes, focus returns.\n  - Zoom to 200%, and a 320px wide window: nothing lost or overlapping.\n  - A screen reader for 5 minutes: VoiceOver on macOS (Cmd+F5; VO+U opens\n    the rotor with headings, links, landmarks and form controls) or NVDA\n    with Firefox or Chrome on Windows (H headings, D landmarks, F form\n    fields). Do the main task; listen for names, states, announcements.\n- Chrome DevTools, Elements, Accessibility pane: each element's computed\n  role and name.\n\n## Check it\n\n- `preview` at 360, 768 and 1440px and in the second theme: text below AA\n  contrast, icons below 3:1, images without alt, controls without a name,\n  touch targets under 44px, the number of `h1`s.\n- `ui_check`: removed focus styles, images without alt, dead controls;\n  `grep -rnE \"\u003C(div|span)[^>]*onClick\" src` for clickable `div`s.\n- axe clean in component and end-to-end tests; the keyboard and screen\n  reader passes above on the screens you built.\n\n## Avoid\n\nClickable `div`s and `href=\"#\"` buttons; icon buttons with no name;\n`outline: none` with nothing in its place; ARIA roles without the keys\nthey promise; `role=\"menu\"` for site navigation; `tabindex` above 0;\ndialogs that let focus escape or never return it; focus lost to the body\nafter a route change or a delete; live regions inserted with their text;\nplaceholder-only fields; colour as the only signal; zoom disabled; a page\ncalled done without a keyboard pass.\n",{"name":5,"description":7},"main","38293fe1b096e6bf3646c7344c38786ed688f464","crates\u002Fenowx-core\u002Fskills\u002Ffrontend-accessibility",21,"https:\u002F\u002Fgithub.com\u002Fenowdev\u002Fenowxcli","https:\u002F\u002Fenowx.ai","https:\u002F\u002Fgithub.com\u002Fenowdev","Pretending to be a Developer","2026-10-06 02:05:35",{"source":8,"skillName":5,"commands":54,"prompt":64,"zipAvailable":65},[55,58,61],{"tool":56,"command":57},"npx","npx skills add enowdev\u002Fenowxcli --skill frontend-accessibility",{"tool":59,"command":60},"bunx","bunx skills add enowdev\u002Fenowxcli --skill frontend-accessibility",{"tool":62,"command":63},"pnpm","pnpm dlx skills add enowdev\u002Fenowxcli --skill frontend-accessibility","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fenowdev\u002Fenowxcli\u002Fblob\u002Fmain\u002Fcrates\u002Fenowx-core\u002Fskills\u002Ffrontend-accessibility\u002FSKILL.md",true,[],[68,79,95,107,126,145],{"skillNo":69,"name":70,"nameZh":6,"description":71,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":72,"categories":73,"keywords":74,"publishedAt":39},"01M6D2HQYSQD9N7MTNDT4A7CBM","demo-skill","Project-scope demo skill for tests.","https:\u002F\u002Fgithub.com\u002Fenowdev\u002Fenowxcli\u002Fblob\u002Fmain\u002Fworkspace\u002F.agents\u002Fskills\u002Fdemo-skill\u002FSKILL.md",[],[75,76,77,78,31],"demo skill","demo","tests","project",{"skillNo":80,"name":81,"nameZh":6,"description":82,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":83,"categories":84,"keywords":85,"publishedAt":39},"01M6D2HM0GCPM0TM2HPG9HHR2R","writing","Writing words people read: the specific thing instead of claims, words to drop, sentences, interface copy (buttons, labels, errors, empty states, confirmations), page copy, notifications and emails, alt text and link text, numbers and dates, words that translate well, documentation and voice. Read before writing a page's copy, an interface's text or a document.","https:\u002F\u002Fgithub.com\u002Fenowdev\u002Fenowxcli\u002Fblob\u002Fmain\u002Fcrates\u002Fenowx-core\u002Fskills\u002Fwriting\u002FSKILL.md",[],[81,86,87,88,89,90,31,34,91,92,93,94],"text","emails","empty","drop","document","voice","notifications","documentation","translate",{"skillNo":96,"name":97,"nameZh":6,"description":98,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":99,"categories":100,"keywords":101,"publishedAt":39},"01M6D2HG07YS49NM196Q0R3AZ8","ui","Designing or restyling an interface: direction, layout, type, colour, icons, components, states, responsive behaviour. Read before building a page, a screen or a set of components.","https:\u002F\u002Fgithub.com\u002Fenowdev\u002Fenowxcli\u002Fblob\u002Fmain\u002Fcrates\u002Fenowx-core\u002Fskills\u002Fui\u002FSKILL.md",[],[97,102,103,104,105,34,106,31,32],"icons","components","SET","responsive","layout",{"skillNo":108,"name":109,"nameZh":6,"description":110,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":111,"categories":112,"keywords":113,"publishedAt":39},"01M6D2HB59HZHWG1RYZDV4SJ91","ui-themes","Light and dark themes, and colour that holds in both: tokens with a value per theme, and what each kind of content needs to stay visible (icons, SVG drawings and line art, logos, photos, screenshots, charts, code, maps, borders, shadows, focus, form controls), switching without a flash, and checking both. Read before building a second theme or a theme toggle, and before any drawing, logo or chart on a page that has two themes.","https:\u002F\u002Fgithub.com\u002Fenowdev\u002Fenowxcli\u002Fblob\u002Fmain\u002Fcrates\u002Fenowx-core\u002Fskills\u002Fui-themes\u002FSKILL.md",[],[97,114,115,116,117,118,25,119,120,31,32,121,34,37,122,123,102,124,125],"ui themes","switching","photos","tokens","drawing","maps","Art","flash","Charts","content","screenshots","logo",{"skillNo":127,"name":128,"nameZh":6,"description":129,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":130,"categories":131,"keywords":132,"publishedAt":39},"01M6D2H5R5KRAE524C8QX0T7Q0","ui-structure","Structure before styling: the blueprint written before any interface code (the screen's job, the regions its kind of page needs, their order and why, the layout skeleton in numbers, the components and their states), the anatomy and order of a homepage, a dashboard, a list, a detail page, settings, a form, sign-in, pricing, docs, an article and a checkout, and how to turn the blueprint into code (tokens, layout primitives, components, sections, page). Read first, before building or rebuilding any page or screen.","https:\u002F\u002Fgithub.com\u002Fenowdev\u002Fenowxcli\u002Fblob\u002Fmain\u002Fcrates\u002Fenowx-core\u002Fskills\u002Fui-structure\u002FSKILL.md",[],[133,97,134,103,135,136,37,137,138,139,106,117,140,141,142,31,32,34,143,144],"structure","ui structure","pricing","dashboard","Blueprint","article","anatomy","styling","primitives","list","why","how",{"skillNo":146,"name":147,"nameZh":6,"description":148,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":149,"categories":150,"keywords":151,"publishedAt":39},"01M6D2H0ZZBJG77MBGPZHA6MWD","ui-stack-vue","Building interfaces in Vue 3 and Nuxt: project layout, script setup with typed defineProps, defineEmits and defineModel, attribute fallthrough, slots and scoped slots, template refs, ref, reactive and computed, watch versus watchEffect, composables and VueUse, provide and inject, Pinia, keyed v-for, transitions, Nuxt 4 (app directory, pages, layouts, useFetch and useAsyncData keys, $fetch in handlers, server routes, runtime config, useSeoMeta, NuxtImg, middleware), VeeValidate forms, Reka UI and Nuxt UI, testing, vue-tsc, and the traps. Read when the project uses Vue or Nuxt.","https:\u002F\u002Fgithub.com\u002Fenowdev\u002Fenowxcli\u002Fblob\u002Fmain\u002Fcrates\u002Fenowx-core\u002Fskills\u002Fui-stack-vue\u002FSKILL.md",[],[97,152,153,154,27,155,156,157,106,78,158,159,31,160,161,162,163,164,165,23],"vue","stack","ui stack vue","pages","watch","runtime","transitions","fetch","pinia","nuxt","template","server","config","directory"]