F5: accessibility lint rules — text-contrast, missing-alt-text, heading-order - #29
Merged
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #27 — the free accessibility judgments (epic #22, build step F5).
What
Three a11y rules in the free default rule set, feeding
lint-pagetoday andverify-page(F4) next. All three feature-detect the companionSaddle_Lint_Style_Accessor(#28) and stay silent on accessors that haven't caught up.text-contrast— generalizesbutton-contrastto 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 staybutton-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.
instanceofskip works cross-repo exactly as the companion design intends🤖 Generated with Claude Code