fix(site): fix accessibility issues in the docs site - #1535
Merged
Merged
Conversation
Lighthouse accessibility on the 12 docs pages goes from 57-90 to 93-100. Everything still failing comes from Pure's own CSS, which is unchanged. - Darken body text (#777 -> #666), subheads (#888 -> #666), links (#3b8bba -> #31739a) and the accent blue (#1f8dd6 -> #1a75b3) so they meet 4.5:1 on every background they sit on. - Underline links in running text, and make callout links white. - Use the a11y-light syntax highlighting theme for code blocks. - Wrap page content in <main>; give the menu toggle aria-label, aria-controls and aria-expanded (kept in sync by ui.js). - Make footer links at least 24px tall. - Homepage: fix size chart and demo button contrast. - Buttons page: darken the custom button example backgrounds. - Forms page: label the read-only and rounded input examples. - Tools page: move list descriptions inside their <li>s. Fixes #1204 Co-Authored-By: Claude Opus 5.5 (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.
Fixes #1204.
Fixes every Lighthouse accessibility failure on the docs site except the ones that come from Pure's own CSS. Those are left as they are, since changing them would change Pure for everyone who uses it.
Lighthouse accessibility (13.5), 12 docs pages
8 of 12 pages now score 100. The only failures left are on
/buttons/,/forms/,/layouts/and/menus/. All of them come from Pure's own CSS:.pure-button-primary: white on#0078e7, 4.33:1.pure-button-disabled#777on#eee.pure-menu-link:#777on white, 4.47:1Production numbers are from
pure-css.github.io. Everypurecss.io/<path>URL currently 301s to the github.io homepage and drops the path. That redirect is set up outside this repo.Changes
Site-wide (
site/static/css/main.css,Layout.js,Menu.js,ui.js,CodeBlock.js)#fafafaand code blocks:#777→#666.#888→#666.#3b8bba→#31739a.#1f8dd6→#1a75b3. It's used for callouts, the Get Started button and the selected menu item.p,li,td,dd) are underlined, so they don't rely on color alone. Pure buttons and menu links are excluded. Links in callouts are now white.a11y-lighttheme instead ofdocco.<main>.aria-label="Menu"andaria-controls="menu".aria-expandedis kept in sync byui.js.Page-specific
aria-labels. They also appear in the snippets.<li>s. The list had stray text nodes.Visual impact
I compared production and this branch side by side on each changed area, desktop and mobile. Screenshots are available on request.
Testing
eslintpasses.docusaurus serve) for all 12 pages in mobile and desktop modes.🤖 Generated with Claude Code