Repository navigation
Conversation
Adjust two neutral text tokens, add a control-border token and a warning token, and swap a few primary shades in markup so text and control boundaries clear their WCAG minimum. No primary or brand colour values change.
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.
Fix WCAG 2.2 AA contrast failures in light and dark mode
Closes #2049
Summary
The site fails WCAG 2.2 Level AA colour contrast (1.4.3) in both colour schemes, and
/appshas two small non-contrast issues as well. This PR fixes them with 29 added and 25 removed lines across 7 files. The change is two neutral text tokens, one new control-border token, one new warning token, and a handful of class swaps. No primary or brand colour is redefined, no component is restructured, and nothing new is installed.Before this change axe reported 38
color-contrastnodes on/in light mode and 245 on/appsin light mode. Lighthouse scored 95 on/and 91 on/appsin dark mode. After this change axe reports 0 violations on 8 routes in both schemes, and Lighthouse scores 100 on both pages.Screenshots
Both sheets show the same viewport region captured before and after. Each element is labelled with its measured ratio.
The change is a contrast shift, so at full-page scale it reads as slightly crisper text rather than a redesign. The sheet crops make it visible on card subtitles and install counts, the A to Z filter chips, the search placeholder, and the filter panel labels.
What changed, file by file
src/styles/global.css--color-text-mutedmoves from#7B7883/#938F99to#5A5761/#B7B4BE.--color-text-subtlemoves from#9F9BA3/#787579to#6B6973/#A19EA8.--color-border-strongis new at#85828F/#A5A1AC, and--color-warningis new at#7C4A02/#FCD34D.src/components/FilterForm.astroborder-border-strong. The placeholder moves fromplaceholder-text-subtletoplaceholder-text-muted.src/components/AppCard.astroh3toh2.<h1>for Apps was skipping toh3, which trippedheading-order.src/components/Pagination.astroaria-label="Previous page"andaria-label="Next page".link-nameunder 2.4.4 and 4.1.2.src/pages/apps.astrotext-primary-300totext-primary-600. The error banner usesbg-error/10 border-error/30 text-error. The empty-state heading moves fromh3toh2.text-primary-300was 3.68:1 in light mode and 2.76:1 in dark mode. The red banner was 1.98:1. The heading level is fixed for the same reason as above.src/pages/redirect.astro<noscript>banner and the intent-blocked banner use thewarningtoken. The error banner uses theerrortoken. The app link moves fromprimary-400toprimary-600. The how-to-use heading moves fromh3toh2./apps, and the app link was 3.90:1 in dark mode. The yellow-on-yellow and red-on-red banners were the worst combinations on the site.src/layouts/Layout.astroprimary-400toprimary-600.#2B2930. Both hovers now use an existing darker step at 9.17:1 in light mode and 8.42:1 in dark mode. axe cannot exercise hover-only colours.No
--color-primary-*or--color-brandvalue changes. The primary palette is only used differently in three places, and each one moves to an existing darker step.Contrast, before and after
--color-text-muted#F0EEF6--color-text-subtle#F5F3FA--color-text-muted#36343B--color-text-subtle#2B2930--color-border-strong(new)--color-border-hoveron its fill--color-border-strong(new)--color-border-hoveron its fill--color-warning(new)text-yellow-400onbg-yellow-900/20, and 8.42:1 in dark mode--color-error(now used)text-red-400onbg-red-900/20, and 4.84:1 in dark modeValues are the worst rendered pairing for each token. They were measured from computed styles with translucent backgrounds composited from the bottom up. The ramp keeps its order (
text,secondary,muted,subtle) so the hierarchy is unchanged, and each step simply sits further from the surface behind it.Verification
/,/apps,/apps?category=games,/apps?category=,/apps?q=obtainium,/apps?sort=name&page=2,/redirect, and/redirect?r=..../and/apps, up from 95 and 91npm run typechecknpm run buildnpm testDeliberately not changed
regionlandmark finding is axe best practice rather than A or AA, so it is out of scope here.Reviewer notes
prefers-color-schemeand there is no in-page toggle, so every dark result came from emulating the media feature in the browser.--color-text-subtlenow clears 4.5:1 on cards and on the page. It does not clear 4.5:1 onsurface-altat 4.36:1 in light mode and 3.51:1 in dark mode. Nothing uses that pairing, because the placeholder moved totext-mutedfor exactly this reason, so it should stay that way./appserror banner is only reachable when the backend fails. It is fixed in CSS but not covered by the automated run.