Skip to content

F5: accessibility lint rules — text-contrast, missing-alt-text, heading-order - #29

Merged
ifahimreza merged 1 commit into
mainfrom
feat/f5-a11y-rules
Jul 10, 2026
Merged

F5: accessibility lint rules — text-contrast, missing-alt-text, heading-order#29
ifahimreza merged 1 commit into
mainfrom
feat/f5-a11y-rules

Conversation

@ifahimreza

Copy link
Copy Markdown
Contributor

Closes #27 — the free accessibility judgments (epic #22, build step F5).

What

Three a11y rules in the free default rule set, feeding lint-page today and verify-page (F4) next. All three feature-detect the companion Saddle_Lint_Style_Accessor (#28) and stay silent on accessors that haven't caught up.

  • text-contrast — generalizes button-contrast to all text. Effective background = the node's own, else the nearest painted ancestor (walks up like a browser paints). WCAG AA: 4.5:1 normal / 3:1 large (headings, or ≥24px — rendered weight is unknowable from the tree, so the rule under-flags). Buttons stay button-contrast's finding; unknown backgrounds are never guessed.
  • missing-alt-text — content images with missing/empty alt; covers stay decorative → never nagged. Warn, not error.
  • heading-order — skipped levels down (h2→h4) + duplicate h1s; upward moves are new sections; the first heading is never judged.

Tests

Each rule pinned both ways (fires on bad fixture, silent on clean), plus the skip-path proof on a base-only legacy accessor.

  • Free suite 271 green (+8)
  • Pro suite 119 green against the un-upgraded Divi accessor — the instanceof skip works cross-repo exactly as the companion design intends
  • phpcs clean

🤖 Generated with Claude Code

…ding-order

Closed-loop scope (#27): three a11y judgments in the free rule set, feeding
lint-page today and verify-page next. All three feature-detect the companion
Saddle_Lint_Style_Accessor and stay silent on accessors that haven't caught
up (proven against a base-only legacy accessor in the tests).

- text-contrast: generalizes button-contrast to all text. Effective
  background = the node's own, else the nearest painted ancestor (walks up
  like a browser paints). WCAG AA thresholds: 4.5:1 normal, 3:1 large
  (headings, or >=24px) - rendered weight is unknowable from the tree, so
  the rule under-flags rather than cries wolf. Buttons stay button-contrast's
  finding; unknown backgrounds are never guessed at.
- missing-alt-text: content images with missing/empty alt; the accessor
  decides what counts as content (covers stay decorative -> never nagged).
  Warn, not error - the tree can't prove an image is meaningful.
- heading-order: skipped levels on the way down (h2->h4) and duplicate h1s;
  upward moves are new sections and always fine; the first heading is never
  judged against an invisible predecessor.

Every rule pinned both ways (fires on the bad fixture, silent on the clean
one). Free suite 271 green; Pro suite 119 green against the un-upgraded Divi
accessor (the skip path). phpcs clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@ifahimreza
ifahimreza merged commit 6940d04 into main Jul 10, 2026
@ifahimreza
ifahimreza deleted the feat/f5-a11y-rules branch July 10, 2026 00:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

F5: Accessibility rules — text-contrast, missing-alt-text, heading-order

1 participant