Skip to content

Fix tag-pill contrast and make the news-card focus ring visible - #269

Merged
mmcky merged 1 commit into
mainfrom
a11y/news-cards-and-pills
Sep 29, 2026
Merged

mmcky merged 1 commit into
mainfrom
a11y/news-cards-and-pills

Conversation

@mmcky

@mmcky mmcky commented Sep 28, 2026

Copy link
Copy Markdown
Collaborator

This PR fixes the colour-contrast and keyboard-focus problems that the News/Activity design review turned up on the existing pages (#266). It doesn't depend on #265 and merges cleanly with it in either order.

Changes

What Before After
workshop tag pill (white text) #6EAC5B, 2.72:1, fails AA #4a7c3c, 4.95:1
books tag pill (white text) #D25663, 4.00:1, fails AA #b83d4b, 5.52:1
NEW badge on the Books page and the home Books section #e94560, 3.83:1, fails AA #d0344f, 4.90:1
News page meta text: card dates, "Published by" lines, Older Posts dates #888 / #999 (3.54:1 / 2.85:1) #666, 5.74:1
Home "Latest News" card dates #888 #666
News card chevron #aaa, 2.32:1 #64748b, 4.76:1
  • Keyboard focus on news cards is now visible. .news-card has overflow: hidden, which clipped the header button's focus ring, so tabbing onto a card showed nothing.
    • The ring now goes around the whole card, using :has().
    • Browsers without :has() get an inset ring on the button instead.
    • Tested in headless Chrome by tabbing to the first card: the card shows a 2px #0072bc ring.
  • Reduced motion. The card lift and the card and button transitions are turned off for readers who have "reduce motion" set.
  • README. The tag colour table is updated.

The brand variables $qe-green and $qe-red are unchanged, because other parts of the site use them. Only the pill rules change.

On the preview, check:

  • a news card and the home page pills;
  • the NEW badge on /books/;
  • tabbing through /news/ to see the ring around each card.

🤖 Generated with Claude Code

- Tag pills: workshop #6EAC5B -> #4a7c3c (4.95:1) and books #D25663 ->
  #b83d4b (5.52:1), so white text passes WCAG AA. The brand $qe-green /
  $qe-red variables are unchanged.
- "NEW" badge (Books page and the home Books section): #e94560 -> #d0344f
  (4.90:1).
- News page meta text: card dates, "Published by" lines and the Older
  Posts dates move from #888/#999 to #666 (5.74:1); the card chevron from
  #aaa to #64748b (4.76:1). Home news-card dates also move to #666.
- News cards: .news-card has overflow: hidden, which clipped the header
  button's focus ring, so keyboard focus was invisible. The ring now goes
  around the card via :has(), with an inset ring on the button as the
  fallback for browsers without :has().
- Respect prefers-reduced-motion for the card and button transitions.

Part of #266.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@netlify

netlify Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for grand-swan-ca5201 ready!

Name Link
🔨 Latest commit 8abee54
🔍 Latest deploy log https://app.netlify.com/projects/grand-swan-ca5201/deploys/6abaed6e4bc8ac0008965911
😎 Deploy Preview https://deploy-preview-269--grand-swan-ca5201.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copilot AI balanced review requested due to automatic review settings September 28, 2026 22:42

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

The changes are small, well-scoped, presentational-only accessibility fixes whose selectors, colours, and fallbacks I verified as correct and consistent with the codebase.

Review effort: Balanced
Findings: None

What changed in this PR

This PR resolves colour-contrast (WCAG AA) and keyboard-focus accessibility issues on the News/Activity and home pages, following the design review tracked in #266. It darkens several tag-pill and badge colours, lightens low-contrast meta-text greys, and fixes a focus ring that was being clipped by the news card's overflow: hidden. It is purely presentational and touches no logic.

Changes:

  • Darken workshop, books, and NEW badge colours and raise News meta-text greys to #666 so text meets AA contrast with white/background.
  • Make the news-card keyboard focus ring visible: an inset ring on the header button by default, and a full-card ring via :has() where supported (older browsers keep the inset fallback).
  • Add a prefers-reduced-motion block that disables card/button transitions and the card-lift transform, and update the README tag-colour table.
File Description
assets/​main.scss Core changes: AA-compliant pill/badge colours, #666 meta text, :has()-based focus ring with inset fallback, and reduced-motion media query.
README.md Updates the tag colour reference table to the new workshop/books hex values.
_layouts/​home.html Raises the "Latest News" card date colour from #888 to #666 for contrast.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@mmcky mmcky mentioned this pull request Sep 28, 2026
4 tasks done
@mmcky
mmcky merged commit 20d08ef into main Sep 29, 2026
6 checks passed
@mmcky
mmcky deleted the a11y/news-cards-and-pills branch September 29, 2026 00:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants