Repository navigation
Fix public contrast, tap targets, skip link, and 390px header #274
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
57eea69
Fix public-page contrast, tap targets, skip link, and header wrap
cursoragent 29c3b4c
Lighten public hero overlay so the photo stays visible
cursoragent 91f24db
Retrigger JourneyDeck CI for the overlay follow-up
cursoragent 61b48e1
Merge main so the a11y branch includes the #263 hero photos
cursoragent b7dc93d
Merge branch 'main' into cursor/public-a11y-contrast-4d80
drumpat01 dea94a2
Merge remote-tracking branch 'origin/main' into cursor/public-a11y-co…
cursoragent 6c18bfe
Merge main and keep the public a11y stylesheet on home.
cursoragent File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| import assert from "node:assert/strict"; | ||
| import test from "node:test"; | ||
| import { createApp } from "../src/app.js"; | ||
| import { fixtureDatabase, root } from "./helpers.js"; | ||
|
|
||
| const publicPages = ["/", "/privacy", "/support", "/terms", "/apple-music-soundtrack", "/private-driving-journal"]; | ||
|
|
||
| test("public pages expose a skip link, 24px tap targets, and contrast overlay CSS", async () => { | ||
| const fixture = fixtureDatabase(); | ||
| const runtime = await createApp({ databasePath: fixture.filename, root, allowTestAuth: true, legacyUpstream: "", mode: "web" }); | ||
| try { | ||
| const css = await runtime.app.inject({ method: "GET", url: "/public-a11y.css?v=2" }); | ||
| assert.equal(css.statusCode, 200, css.body); | ||
| assert.match(String(css.headers["content-type"]), /text\/css/); | ||
| assert.equal(css.headers["cache-control"], "public, max-age=31536000, immutable"); | ||
| assert.match(css.body, /\.skip-link/); | ||
| assert.match(css.body, /min-height: 24px/); | ||
| assert.match(css.body, /min-width: 24px/); | ||
| assert.match(css.body, /flex-wrap: nowrap/); | ||
| assert.match(css.body, /#081832cc/); | ||
| assert.match(css.body, /#081832b3/); | ||
| assert.doesNotMatch(css.body, /#081832f8|#081832f4|#081832e8/); | ||
| assert.doesNotMatch(css.body, /[\u2013\u2014]/); | ||
|
|
||
| for (const url of publicPages) { | ||
| const page = await runtime.app.inject({ method: "GET", url }); | ||
| assert.equal(page.statusCode, 200, url); | ||
| assert.match(page.body, /class="skip-link" href="#main">Skip to content<\/a>/, url); | ||
| assert.match(page.body, /id="main"/, url); | ||
| assert.match(page.body, /href="\/public-a11y\.css\?v=2"/, url); | ||
| assert.match(String(page.headers["content-security-policy"]), /default-src 'self'/, url); | ||
| } | ||
|
|
||
| const missing = await runtime.app.inject({ method: "GET", url: "/missing-public-page" }); | ||
| assert.equal(missing.statusCode, 404); | ||
| assert.match(missing.body, /class="skip-link" href="#main">Skip to content<\/a>/); | ||
| assert.match(missing.body, /href="\/public-a11y\.css\?v=2"/); | ||
| } finally { | ||
| await runtime.app.close(); | ||
| fixture.cleanup(); | ||
| } | ||
| }); |
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| .skip-link { position: fixed; z-index: 100; top: 8px; left: 8px; transform: translateY(-150%); min-height: 44px; padding: 12px 16px; border-radius: 7px; background: var(--ivory, #f6f0e2); color: var(--navy, #081832); font-size: 14px; font-weight: 650; text-decoration: none; } | ||
| .skip-link:focus { transform: none; } | ||
| .site-header, .header-actions { flex-wrap: nowrap; } | ||
| .site-header .brand { white-space: nowrap; } | ||
| .header-actions .button { white-space: nowrap; flex-shrink: 0; } | ||
| .desktop-nav a { display: inline-flex; align-items: center; min-height: 24px; padding: 6px 2px; } | ||
| .footer a, .footer-bottom a { display: inline-flex; align-items: center; min-height: 24px; padding: 4px 2px; } | ||
| .page-actions { gap: 16px; } | ||
| .contact, .secondary-action { min-height: 52px; } | ||
| .tour-dots button { min-width: 24px; width: 24px; } | ||
| .text-link, .hero-soundtrack-link, .feature-cta, .hero-baseline a { min-height: 24px; } | ||
| section.hero { | ||
| background: linear-gradient(90deg, #081832cc 0%, #081832cc 58%, #081832b3 78%, #08183280 100%), url("/assets/beta/grand-touring-home.webp") center 55% / cover; | ||
| } | ||
| section.hero:not(.has-photo)::before { content: none; } | ||
| section.hero.has-photo::before { | ||
| content: ""; | ||
| position: absolute; | ||
| z-index: 1; | ||
| inset: 0; | ||
| background: linear-gradient(90deg, #081832cc 0%, #081832cc 58%, #081832b3 78%, #08183280 100%); | ||
| pointer-events: none; | ||
| } | ||
| .hero > :not(.hero-photo) { position: relative; z-index: 2; } | ||
| @media (max-width: 620px) { | ||
| section.hero { | ||
| background: linear-gradient(90deg, #081832cc, #081832c6), url("/assets/beta/grand-touring-home.webp") center / cover; | ||
| } | ||
| section.hero.has-photo::before { background: linear-gradient(90deg, #081832cc, #081832c6); } | ||
| } | ||
| @media (max-width: 390px) { | ||
| .site-header { gap: 8px; padding-inline: 12px; flex-wrap: nowrap; } | ||
| .header-actions { gap: 6px; flex-wrap: nowrap; } | ||
| .header-actions .button-small { gap: 6px; padding-inline: 10px; white-space: nowrap; } | ||
| .brand { font-size: 17px; } | ||
| } | ||
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
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because
beta.htmlnow imports this stylesheet and the/front cover is also a<section class="hero section-shell">, this selector unintentionally applies the forest background to the entire home-page hero. That changes the existing plain cover design and eagerly downloads the 322 KB full-size image, even though the homepage previously used responsive, lazy-loaded variants only in its later scenic section. Scope these background rules to the public-page hero variant while retaining the shared header and tap-target fixes on/.Useful? React with 👍 / 👎.