Skip to content
Skills Library
Design & UX · Building & coding

accessible-by-default

/accessible-by-default

Non-negotiable accessibility baseline for any UI an agent builds or restyles: WCAG 2.2 AA contrast, visible focus, 24x24 target size, reduced motion, semantic HTML, text alternatives, and never relying on color alone. Includes a pass/fail checklist and code patterns. Use this skill when building or reviewing any user-facing UI, especially after a visual redesign, or when a distinctive style risks readability. Activate when: accessibility, a11y, WCAG, contrast, focus ring, keyboard navigation, reduced motion, alt text, screen reader, target size, semantic HTML.

Licence
MIT
Last repository change
04.11.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
4
URLs in SKILL.md
7
Deprecation

No signals detected. Repository changed on 04.11.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What to check before installing
  • SKILL.md zawiera komentarze HTML (4). Nie widać ich w podglądzie Markdown, a model je czyta.

What it does and when to use it

Non-negotiable accessibility baseline for any UI an agent builds or restyles: WCAG 2.2 AA contrast, visible focus, 24x24 target size, reduced motion, semantic HTML, text alternatives, and never relying on color alone. Includes a pass/fail checklist and code patterns. Use this skill when building or reviewing any user-facing UI, especially after a visual redesign, or when a distinctive style risks readability. Activate when: accessibility, a11y, WCAG, contrast, focus ring, keyboard navigation, reduced motion, alt text, screen reader, target size, semantic HTML.

Original author description

Non-negotiable accessibility baseline for any UI an agent builds or restyles: WCAG 2.2 AA contrast, visible focus, 24x24 target size, reduced motion, semantic HTML, text alternatives, and never relying on color alone. Includes a pass/fail checklist and code patterns. Use this skill when building or reviewing any user-facing UI, especially after a visual redesign, or when a distinctive style risks readability. Activate when: accessibility, a11y, WCAG, contrast, focus ring, keyboard navigation, reduced motion, alt text, screen reader, target size, semantic HTML.

How it works

  1. When to Use
  2. Workflow
  3. Best Practices
  4. References
Original SKILL.md headings · 157 lines, 1,053 words
SKILL.md preview
---
name: accessible-by-default
description: |
  Non-negotiable accessibility baseline for any UI an agent builds or restyles: WCAG 2.2 AA contrast, visible focus, 24x24 target size, reduced motion, semantic HTML, text alternatives, and never relying on color alone. Includes a pass/fail checklist and code patterns.
  Use this skill when building or reviewing any user-facing UI, especially after a visual redesign, or when a distinctive style risks readability.
  Activate when: accessibility, a11y, WCAG, contrast, focus ring, keyboard navigation, reduced motion, alt text, screen reader, target size, semantic HTML.
---

# Accessible by Default

**Distinctive design is optional; accessible design is not. Apply this baseline to every screen, whatever the visual direction.**

This skill covers the checks that most often break when agents restyle UI. It targets WCAG 2.2 Level AA, a widely used target in accessibility policies. It is a baseline, not a full conformance audit: automated and checklist review do not replace testing with assistive technology and with disabled users.

## When to Use

- Building any page or component
- After applying a new visual direction, palette, or motion system
- Reviewing a PR that changes CSS, colors, interactive elements, or animation

## Workflow

### Step 1: Use Semantic HTML First

Native elements bring keyboard support, focus, and roles for free.

```html
<!-- Before -->
<div class="btn" onclick="save()">Save</div>

<!-- After -->
<button type="button" onclick="save()">Save draft</button>
```

- Links navigate (`<a href>`); buttons act (`<button>`)
- One `<h1>` per page and headings in order; use `<main>`, `<nav>`, `<header>`, `<footer>` landmarks
- Every input has a `<label>` (visible, associated with `for`/`id` or by wrapping)
- Use ARIA only when no native element fits, and then follow the ARIA pattern fully

### Step 2: Meet Contrast Thresholds (Unrounded)

| What | Ratio | WCAG 2.2 |
|------|-------|----------|
| Normal text | 4.5:1 | 1.4.3 Contrast (Minimum), AA |
| Large text: at least 18pt, or 14pt bold (about 24px / 18.5px) | 3:1 | 1.4.3, AA |
| UI component boundaries and states, meaningful graphics, focus indicators | 3:1 against adjacent colors | 1.4.11 Non-text Contrast, AA |
| Enhanced (optional) | 7:1 / 4.5:1 large | 1.4.6, AAA |

W3C states ratios are not rounded: 4.499:1 fails 4.5:1. Logos and purely decorative text are exempt. Check text over images or gradients at the lowest-contrast point.

### Step 3: Keep Focus Visible and Unobscured

```css
/* Never remove focus without replacing it */
:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 2px;
}
```

- 2.4.7 Focus Visible (AA): keyboard focus must be visible. `outline: none` without a replacement fails
- 2.4.11 Focus Not Obscured (Minimum) (AA, new in 2.2): a focused element must not be entirely hidden by author content such as sticky headers or cookie banners. Use `scroll-padding-top` for sticky headers
- 2.4.13 Focus Appearance (AAA) defines a stronger indicator (area at least a 2 CSS px perimeter, 3:1 contrast); a useful target even if you only claim AA
- `:focus-visible` is Baseline widely available and shows the ring for keyboard users without showing it on every mouse click

```css
html { scroll-padding-top: 5rem; } /* height of the sticky header */
```

### Step 4: Size Targets for Pointers and Fingers

2.5.8 Target Size (Minimum) (AA, new in 2.2): pointer targets at least 24 by 24 CSS pixels, unless an exception applies — enough spacing (a 24px circle centered on each target doesn't overlap another), an equivalent larger control on the page, inline links in text, user-agent default controls, or essential presentation. 2.5.5 (AAA) asks for 44 by 44.

```css
.icon-button {
  min-width: 44px;   /* exceeds the 24px AA minimum; matches the AAA size */
  min-height: 44px;
  display: inline-grid;
  place-items: center;
}
```

### Step 5: Respect Motion Preferences

- `prefers-reduced-motion: reduce` indicates the user asked to minimize non-essential motion (Baseline widely available)
- 2.2.2 Pause, Stop, Hide (A): auto-moving content that lasts more than 5 seconds alongside other content needs a way to pause, stop, or hide it
- 2.3.3 Animation from Interactions (AAA): interaction-triggered motion can be disabled unless essential

```css
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
```

The blanket rule is a safety net. Better: design the reduced version deliberately (crossfade instead of slide, no parallax) so meaning conveyed by motion is not lost.

### Step 6: Never Use Color Alone

1.4.1 Use of Color (A): color cannot be the only way to convey information, indicate an action, or distinguish an element.

```html
<!-- Before: red border is the only error signal -->
<input class="border-red">

<!-- After -->
<label for="email">Email</label>
<input id="email" type="email" aria-invalid="true" aria-describedby="email-err">
<p id="email-err" class="error">Enter an email address like name@example.com</p>
```

Links inside body text should be distinguishable by more than color (underline is the simplest choice).

### Step 7: Provide Text Alternatives

1.1.1 Non-text Content (A):

- Informative image: `alt` describes the information, not the file ("Invoice total 336 EUR, due 30 November")
- Decorative image: `alt=""` so screen readers skip it
- Icon-only button: accessible name via visible text, `aria-label`, or visually hidden text
- Charts: a text summary or data table nearby

### Step 8: Allow Zoom, Reflow, and Text Spacing

- 1.4.10 Reflow (AA): content works without two-direction scrolling at 320 CSS px wide (vertical content) — test at 400% zoom on a 1280px window
- 1.4.12 Text Spacing (AA): no loss of content when users raise line height to 1.5x, paragraph spacing 2x, letter spacing 0.12x, word spacing 0.16x
- Never set `maximum-scale=1` or `user-scalable=no` in the viewport meta

### Step 9: Verify

| Check | How |
|-------|-----|
| Keyboard | Tab through the whole page: every control reachable, order logical, focus always visible, no traps |
| Contrast | Contrast checker on every text/background and component pair, both themes |
| Zoom/reflow | 400% zoom at 1280px width; 320px viewport |
| Motion | Turn on the OS reduced-motion setting and reload |
| Screen reader | Spot-check headings, landmarks, form labels, and buttons with VoiceOver or NVDA |
| Automated | Run an automated checker; treat it as a floor (it finds only some issues) |

## Best Practices

1. Native HTML before ARIA
2. Contrast ratios are thresholds, checked unrounded, in every theme
3. Replace focus styles; never just remove them
4. Account for sticky UI hiding focused elements
5. Size touch targets generously; 24px is the AA floor, not a goal
6. Design the reduced-motion experience, don't only switch motion off
7. Pair color with text, shape, or pattern
8. Test with a keyboard on every change; it takes minutes

## References

- WCAG 2.2: https://www.w3.org/TR/WCAG22/
- Understanding 1.4.3 Contrast (Minimum): https://www.w3.org/WAI/WCAG22/Understanding/contrast-minimum.html
- Understanding 2.5.8 Target Size (Minimum): https://www.w3.org/WAI/WCAG22/Understanding/target-size-minimum.html
- Understanding 2.5.5 Target Size (Enhanced): https://www.w3.org/WAI/WCAG22/Understanding/target-size-enhanced.html
- Understanding 1.4.10 Reflow: https://www.w3.org/WAI/WCAG22/Understanding/reflow.html
- MDN, `prefers-reduced-motion`: https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-reduced-motion
- MDN, `:focus-visible`: https://developer.mozilla.org/en-US/docs/Web/CSS/:focus-visible

Versions

The database has no other skills named accessible-by-default.

Database snapshot: 13.11.2026 · package version e04e644bf14e (SHA-256 digest of the entire package)

Downloads in the last 30 days: 2 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100accessibility-expert
    Expert web accessibility (a11y): WCAG 2.2 AA, semantic HTML, ARIA, keyboard, and screen readers. Trigger keywords: accessibility, a11y, WCAG, ARIA, role, screen reader, keyboard navigation, focus, focus trap, contrast, alt text, semantic HTML, label, axe, tab order. Use to build…
  • 90a11y-audit
    Audit and fix website accessibility to WCAG 2.2 AA — semantic HTML, keyboard navigation, focus, labels, alt text, color contrast, ARIA, and screen-reader behavior — in React/Next.js, Vue, or plain HTML. Use whenever the user mentions accessibility, a11y, WCAG, screen readers,…
  • 90accessibility
    Enforce WCAG 2.2 AA by default (keyboard, ARIA, focus, contrast, semantics, target size, dragging alternatives, accessible authentication). Use for accessibility work, pre-ship UI checks, and as a light pass on every UI build or design review — including "a11y", "keyboard",…
  • 100accessibility
    Build and audit UI to WCAG 2.2 Level AA - semantic HTML first, correct names/roles/states, keyboard and focus management, forms and errors, contrast, target size, reflow, motion and live regions - verified by automated scans plus manual keyboard and screen-reader checks. Use…
  • 90accessibility
    Accessibility to WCAG 2.2 AA on web, iOS (SwiftUI) and Android (Compose) - semantics, ARIA, keyboard and focus, contrast, target size, forms, reduced motion. Use for a11y audits and fixes.
  • 100web-accessibility
    Builds and audits web UIs to WCAG 2.2 level AA - semantic HTML, correct ARIA, keyboard and focus handling, accessible forms and errors, alt text, color contrast, target size, dialogs, live regions and motion - and tests with automated tools plus keyboard and screen reader…

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.