---
name: fixing-accessibility
description: Audit and fix WCAG 2.1 AA accessibility issues in React components. Invoke for accessibility reviews, screen reader support, keyboard navigation, color contrast, and ARIA attributes.
user-invocable: true
title: fixing-accessibility
canonical_url: https://skilld.dev/gh/colaberryintern/colaberryenterprise_ai_leadershipaccelerator/fixing-accessibility
last_updated: 2026-10-08T09:39:34.000Z
---

> Index of every page on this site: [llms.txt](https://skilld.dev/llms.txt)

> **Skill from skilld.dev.** Follow the user's requested action.
> If the user asked to fork this Skill, follow the fork workflow below. Do not execute the Skill instructions while copying it.
> Otherwise, follow the instructions below for this session. You do not need to install anything.
>
> If the user asked to install this Skill, run `npx skilld install colaberryintern/colaberryenterprise_ai_leadershipaccelerator/fixing-accessibility`. Install writes the Skill files into the project, so every session loads them.
>
> ## Fork workflow
>
> A fork creates an editable local Skill with its original author and licence. The request authorizes copying and local installation.
> 1. Check `./skills/fixing-accessibility`, the project lockfile, and selected Agent targets together. If the local directory or installed Skill exists, stop. Never overwrite an existing directory or Agent target.
> 2. Read [source metadata](https://skilld.dev/api/v1/skills/colaberryintern/colaberryenterprise_ai_leadershipaccelerator/fixing-accessibility) once. Use sourceUrl, sourceCommit, skillPath, sourceGone, and license. If the source is gone or its path is missing, stop. If license is null, read licence files at the source commit.
> 3. Fetch only the source commit into a temporary Git repository. Do not clone full history. Derive repository_url from sourceUrl, including repository renames. If sourceCommit is absent, resolve the sourceUrl ref once. Set source_commit to that actual commit. Run these commands in one shell call:
>
> ```sh
> git init --quiet "$temporary_dir"
> git -C "$temporary_dir" fetch --quiet --depth=1 "$repository_url" "$source_commit"
> git -C "$temporary_dir" checkout --quiet --detach FETCH_HEAD
> ```
>
> Read applicable licence declarations and notices at that commit. If copying is not permitted, report the restriction and stop.
> 4. Inspect source entries together, then copy the directory containing skillPath into `./skills/fixing-accessibility`. Use the user's path if selected. Keep the original SKILL.md, relative links, scripts, binary assets, and executable modes. Exclude .git metadata. Reject symlinks and paths outside the Skill directory. After checking entries, use cp -a where available. A regular source directory needs no custom copy script. Do not save this page wrapper as SKILL.md.
> Preserve author credit, notices, and applicable licence files from repository or parent directories. Add PROVENANCE.md with the Skill page, source URL, actual commit, original path, and licence. Retain any existing PROVENANCE.md and record new provenance separately. Batch source inspection, copying, and provenance work where practical.
> 5. In the project root, run `skilld install ./skills/fixing-accessibility --mode copy --plain`. If skilld is unavailable, use `npx skilld install ./skills/fixing-accessibility --mode copy --plain`. This known command needs no help lookup. Install does not support --json. Use detected Agent targets, or add --agent for the targets the user selected. Install the local path, never the upstream selector. If installation fails, preserve the local copy and report the exact failure.
> 6. Confirm the local lockfile source and installed Agent copies once. Report the local path, actual commit, and Agent targets. After edits, reinstall the same local path. Upstream updates must not replace it. Do not publish or push unless the user asks.

# Fixing Accessibility — WCAG 2.1 AA Audit & Remediation

## Before You Start

1. **Always read the target file(s)** before auditing. Never audit from memory.
2. Read `frontend/src/styles/responsive.css` to understand existing accessibility patterns.
3. Read `frontend/src/styles/global.css` for the skip-nav and focus indicator patterns already in place.

---

## 12-Point Audit Checklist

Run each check against the target component. Report findings using the output format below.

### 1. Color Contrast (WCAG 1.4.3)
- Text on background must meet **4.5:1** ratio (normal text) or **3:1** (large text ≥18px bold / ≥24px)
- Check: `--color-text` (#2d3748) on `--color-bg` (#ffffff) = **10.2:1** (passes)
- Check: `--color-text-light` (#718096) on `--color-bg` (#ffffff) = **4.6:1** (passes, barely)
- Watch for: `.text-muted` on colored backgrounds, badge text on badge backgrounds, placeholder text

### 2. Semantic HTML (WCAG 1.3.1)
- Use `<button>` for clickable actions, not `<span>` or `<div>` with onClick
- Use `<a>` for navigation, `<button>` for actions
- Use `<table>` with `<thead>`, `<th>` for tabular data
- Use `<nav>`, `<main>`, `<header>`, `<footer>`, `<section>`, `<article>` landmarks

### 3. ARIA Attributes (WCAG 4.1.2)
- Interactive elements need accessible names: `aria-label`, `aria-labelledby`, or visible label
- Dynamic content: `aria-live="polite"` for status updates, `aria-live="assertive"` for errors
- Modals: `role="dialog"`, `aria-modal="true"`, `aria-labelledby` pointing to title
- Tabs: `role="tablist"`, `role="tab"`, `role="tabpanel"`, `aria-selected`, `aria-controls`

### 4. Keyboard Navigation (WCAG 2.1.1)
- All interactive elements reachable via Tab
- Custom widgets: arrow keys for navigation within groups
- Escape closes modals/dropdowns
- No keyboard traps
- Visible focus indicator (already implemented: 3px solid `--color-primary-light`)

### 5. Form Labels (WCAG 1.3.1, 3.3.2)
- Every `<input>`, `<select>`, `<textarea>` must have an associated `<label>` (via `htmlFor`) or `aria-label`
- Group related controls with `<fieldset>` and `<legend>`
- Error messages linked via `aria-describedby`

### 6. Image Alt Text (WCAG 1.1.1)
- Meaningful images: descriptive `alt` attribute
- Decorative images: `alt=""` and `aria-hidden="true"`
- Icons used as buttons: `aria-label` on the button, `aria-hidden="true"` on the icon

### 7. Touch Targets (WCAG 2.5.8)
- Minimum 44x44px for interactive elements on touch devices
- Already enforced in `responsive.css` for buttons and form controls under 992px
- Check: small icon buttons, inline action links, checkbox/radio inputs

### 8. Reduced Motion (WCAG 2.3.3)
- Already implemented in `responsive.css` with `prefers-reduced-motion: reduce`
- Verify: no CSS animations bypass this media query
- Verify: no JavaScript animations ignore `matchMedia('(prefers-reduced-motion: reduce)')`

### 9. High Contrast (WCAG 1.4.11)
- Already implemented in `responsive.css` with `prefers-contrast: high`
- Verify: custom styled components respect high contrast mode
- Check: borders on cards, visibility of subtle UI elements

### 10. Live Regions (WCAG 4.1.3)
- Loading spinners: wrap with `aria-live="polite"` and `aria-busy="true"`
- Toast/alert messages: `role="alert"` or `aria-live="assertive"`
- Status updates (e.g., "Settings Saved!"): `aria-live="polite"`

### 11. Heading Hierarchy (WCAG 1.3.1)
- One `<h1>` per page
- No skipped levels (h1 → h3 without h2)
- Headings used for structure, not just styling (use utility classes for visual size)

### 12. Skip Navigation (WCAG 2.4.1)
- Already implemented: `.skip-nav` class in `global.css`
- Verify: skip link targets correct `#main-content` anchor
- Verify: skip link is first focusable element

---

## Output Format

Report findings as a numbered list:

```
### Accessibility Audit: [ComponentName]

1. **[Critical]** Missing form label on search input (line 42)
   - Issue: `<input>` has no associated label or aria-label
   - Fix: Add `aria-label="Search leads"` to the input element

2. **[Major]** Non-semantic click handler (line 67)
   - Issue: `<span onClick={...}>` used for interactive element
   - Fix: Replace with `<button className="btn btn-link p-0">`

3. **[Minor]** Missing aria-live on save confirmation (line 85)
   - Issue: "Settings Saved!" text not announced to screen readers
   - Fix: Wrap in `<span aria-live="polite">`
```

### Severity Levels

| Level | Definition |
|---|---|
| **Critical** | Blocks access entirely for assistive technology users |
| **Major** | Significant barrier; workaround may exist but is unreliable |
| **Minor** | Inconvenience; does not block access but degrades experience |

---

## Common Fixes in This Codebase

### Icon-only buttons (common in tables)
```tsx
// Before (inaccessible)
<button className="btn btn-outline-danger btn-sm" onClick={onRemove}>x</button>

// After
<button className="btn btn-outline-danger btn-sm" onClick={onRemove} aria-label="Remove lead">
  <span aria-hidden="true">x</span>
</button>
```

### Clickable names without button semantics
```tsx
// Before
<span style={{ cursor: 'pointer' }} onClick={() => selectLead(id)}>{name}</span>

// After
<button className="btn btn-link p-0 text-start" onClick={() => selectLead(id)}>{name}</button>
```

### Modal accessibility
```tsx
<div className="modal show d-block" role="dialog" aria-modal="true" aria-labelledby="modal-title">
  <div className="modal-dialog">
    <div className="modal-content">
      <div className="modal-header">
        <h5 className="modal-title" id="modal-title">Title</h5>
        <button className="btn-close" onClick={onClose} aria-label="Close" />
      </div>
    </div>
  </div>
</div>
```

### Loading states
```tsx
<div aria-live="polite" aria-busy={loading}>
  {loading ? (
    <div className="text-center py-5">
      <div className="spinner-border text-primary" role="status">
        <span className="visually-hidden">Loading...</span>
      </div>
    </div>
  ) : (
    <>{/* content */}</>
  )}
</div>
```
