Merged
Conversation
…nded Co-authored-by: mdlew <47911000+mdlew@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Review web app styles for WCAG 2.2 compliance
WCAG 2.2 accessibility compliance fixes
Mar 9, 2026
There was a problem hiding this comment.
Pull request overview
This PR updates the server-rendered HTML/CSS/JS in src/ssr.ts to address WCAG 2.2 accessibility issues (focus visibility, contrast, and ARIA state) in the Cloudflare Worker’s rendered page.
Changes:
- Adds a time-aware semi-transparent overlay for
#container/footer, updates text/accent colors to maintain contrast across all gradients, and introduces a high-contrast:focus-visibleoutline for collapsible buttons. - Adds
aria-expanded/aria-controlsto collapsible buttons and togglesaria-expandedin the click handler. - Introduces a
.gitignoreto ignorenode_modules/.
Reviewed changes
Copilot reviewed 1 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/ssr.ts | Time-aware contrast + focus styling, link hover cue, and ARIA-expanded state management for collapsibles. |
| .gitignore | Ignores node_modules/. |
You can also share your feedback on Copilot code review. Take the survey.
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.
The page had three WCAG violations: keyboard focus completely suppressed on collapsible buttons (
outline:none), text contrast failures on afternoon/dusk gradients (as low as 2.0:1), and collapsible buttons missingaria-expandedstate.Focus appearance (SC 2.4.11 — new in WCAG 2.2)
outline: nonefrom.collapsible.collapsible:focus-visiblewith a time-aware 3 px solid outline:blackduring day (≥13:1 vs. light container, 3.1:1 vs.#8A3B12button),whiteat night (6.8:1 vs. button, high vs. dark container)Contrast (SC 1.4.3)
The old code used
color: white+accentColor: #f6821ffrom hour 13 onward. The afternoon sky gradient (#57c1eb, L≈0.47) gave 2.0:1 against white — well below the 4.5:1 minimum.Three-part fix:
hour < 13→hour < 18#f6821f(fails on warm sunset stops) towhite#containerandfooterto handle the dark navy stops that appear in late-afternoon gradients:The 24 time-responsive body gradients are fully preserved — the overlay only applies to the content card; the raw gradient remains visible in the
2embody padding.Morning (09:00) — day mode, black text, 25% white overlay:

Afternoon (13:00) — previously failing; now black text on white-tinted card:

Night (22:00) — white text, 45% black overlay, focus ring visible:

ARIA state (SC 4.1.2)
aria-expanded="false"+aria-controlsto all collapsible<button>elements; added matchingidto each content<div>aria-expandedon click so screen readers track open/closed stateLink hover
a:hoverpreviously resolved to the same colour as body text (no visible change). Changed totext-decoration: underline dottedfor a colour-independent hover cue.💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.