Repository navigation
Accessibility basics: viewport, alt text, heading order, contrast - #62
Merged
Merged
Conversation
The page template had no viewport meta, so a phone rendered the page at desktop width and scaled it down; two logo images had no alt; the sidebar's "Table of contents" was an h5 after an h3; and the current page's link, the slogan and dark-theme inline code fell below the 4.5:1 contrast WCAG AA asks of body text (2.41, 3.95 and 2.93). Now: a viewport meta, alt="" on the decorative logos (the name follows as text), an h4 styled at the h5's size, the sidebar as a labelled nav landmark with its icons hidden from screen readers, a title instead of the invalid alt on the home link, and greys of 4.54 to 6.15:1. Part of #31. Co-Authored-By: Claude Opus 5.5 <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.
Part of #31, which reports an accessibility score of 67 on PageSpeed. The template every page uses had these defects:
<meta name="viewport">, so a phone drew the page at desktop width and scaled it downwidth=device-width, initial-scale=1alton eitheralt="", since they are decorative and the name follows as texth3AngouriMath thenh5Table of contents, skipping a levelh4, styled at the size theh5haddivnavlabelled Site; its icons havearia-hiddenalt="…"on an<a>, which is not an attribute ofatitle="…"#A7A7A7on white, 2.41:1#767676, 4.54:1color: gray: 3.95:1 light, 4.79:1 dark#6E6E6Elight, 5.1:1;#8B949Edark, 6.15:1darkgrayon#5A5A5A, 2.93:1#E6E6E6, 5.53:1The ratios are WCAG's relative-luminance contrast, computed from the colour values. AA asks 4.5:1 for body text.
Built locally and checked in a headless browser at 1400 px in both themes and at 400 px. The layout is unchanged except on a phone, where the text is now at its readable size instead of shrunk. I could not run Lighthouse itself: PageSpeed's shared quota was exhausted, so there is no new score here. The live page should be measured after the merge.
Not in this PR: a pink link on dark inline code is 4.48:1, just under 4.5, and I have not audited the pages other than the home page.
🤖 Generated with Claude Code