LazyCats-dev/ao3-podfic-posting-helper / .agent/skills/frontend-a11y
frontend-a11y
VerifiedWrite minimal, accessible web UI without over-engineering, adapting to whatever stack the project uses — React, Vue, Svelte, Angular, web components, or plain HTML. Use this skill on every project and every task that writes or reviews markup or components, builds forms, adds interactive elements like buttons, dialogs, accordions, or tabs, or audits code for accessibility — even when the user never mentions accessibility, and even inside a framework, CMS, or design system. It's non-negotiable regardless of project type, stack, or deadline. About to reach for ARIA attributes, a dialog library, a focus-trap package, or a headless UI component? Use this skill first.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 27.7 KB |
| evals/evals.json | config | 12.9 KB |
| references/angular.md | markdown | 2.5 KB |
| references/aria.md | markdown | 503.4 KB |
| references/css.md | markdown | 7.4 KB |
| references/patterns.md | markdown | 8.3 KB |
| references/react.md | markdown | 3.7 KB |
| references/standards.md | markdown | 1.2 KB |
| references/svelte.md | markdown | 2.4 KB |
| references/vue.md | markdown | 2.9 KB |
| references/wcag.json | config | 141.1 KB |
| references/web-components.md | markdown | 2.8 KB |
references/angular.md
View on GitHub# Angular
The HTML/CSS rules in `SKILL.md` all hold — Angular renders the same DOM. This file covers the Angular-specific deltas. Prefer native `<button>`, `<dialog>`, `<details>`, `<label>` here too.
## Bind ARIA with [attr.aria-*], not [aria-*]
The biggest Angular a11y gotcha: `aria-*` are HTML **attributes**, not DOM properties, so a dynamic binding needs the `attr.` prefix. `[aria-expanded]="open"` silently does nothing; `[attr.aria-expanded]="open"` works. Static ARIA is written plain.
```html
<!-- Don't — no such property, binding is dropped -->
<button [aria-expanded]="open">Menu</button>
<!-- Do — attribute binding -->
<button type="button" [attr.aria-expanded]="open" aria-controls="menu" aria-label="Menu">
<svg aria-hidden="true">...</svg>
</button>
```
`role` is the same: `[attr.role]="..."` when dynamic. `[class]`/`[class.x]` and `(click)` follow normal Angular binding.
## Don't put (click) on a div
A `<div (click)>` isn't focusable or keyboard-operable and Angular's template linter will flag it. Use a native `<button>` (see "Use Native Elements").
## innerHTML is sanitized by default — keep it that way
Angular sanitizes `[innerHTML]` bindings, which protects you from XSS. `DomSanitizer.bypassSecurityTrustHtml` removes that protection — only use it on content you fully control, never on user or CMS input.
## Route changes must move focus and announce
The Angular Router swaps components without a page load, stranding focus and announcing nothing. Subscribe to `NavigationEnd` and:
- Move focus to the new view's `<h1>`/`<main>` (`tabindex="-1"` + `.focus()`), **or** use the CDK `LiveAnnouncer` (`announce()`) to speak the new page name.
- Set a unique page `<title>` per route (`Title` service or route `title`) and render one `<h1>`.
## Use the CDK a11y primitives
`@angular/cdk/a11y` gives you `LiveAnnouncer` (polite/assertive announcements), `cdkTrapFocus` (focus trapping for custom overlays), and `FocusMonitor` (focus-origin-aware styling). Prefer these over hand-rolled focus code. For dialogs, still prefer native `<dialog>` + `showModal()`; if you use Angular Material / CDK Dialog, it manages the trap for you.
## Component libraries: verify the rendered element
Angular Material and other kits usually render correct native semantics, but wrappers can emit a `<div>` styled as a control. Confirm the DOM output is a real `<button>`/`<input>` with the expected role and keyboard behavior — the a11y lives in the rendered element, not the selector.
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit. | Stars: 471k | Updated | Claude CodeCodex | Verified | Install |
| rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure. | Stars: 471k | Updated | Claude CodeCodex | Verified | Install |
| rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics. | Stars: 471k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |