Skip to content

fix(a11y): surface-aware syntax highlighting, fix dark mode heading and button contrast#431

Merged
perasperaactual merged 1 commit into
devfrom
fix/a11y-batch-2-contrast
May 16, 2026
Merged

fix(a11y): surface-aware syntax highlighting, fix dark mode heading and button contrast#431
perasperaactual merged 1 commit into
devfrom
fix/a11y-batch-2-contrast

Conversation

@perasperaactual
Copy link
Copy Markdown
Contributor

Summary

Color contrast fixes from the CI accessibility audit. Stacks on top of #430 — merge that first.

Root cause

The docs theme is dark-mode-first: its light mode has a dark navy surface (#1A2C46) and its dark mode has a near-white surface (#F5F5F5). The syntax highlighter was choosing token palettes based on colorMode === 'dark', which is exactly backwards for this theme, causing 30–42 failing elements per page.

Changes

  • CodeBlock.tsx — replaces colorMode === 'dark' with a luminance check on theme.colors.surface. Token palette now adapts to the actual rendered surface color regardless of how the theme names its modes. Uses existing hexToRgb + getLuminance from colorUtils.ts.
  • stackwright.yml — changes darkColors.primary from #D97706 (amber-600, ~2.77:1 on light backgrounds) to #92400e (amber-800, ~5.82:1) — WCAG AA compliant on the #F5F5F5 surface used in dark mode.
  • ThemedButton.tsx — contained-variant buttons now auto-select text color (dark vs light) using getBetterTextColor() based on the resolved background, fixing the #fff on #FCC03E issue (was 1.64:1, now uses dark text for sufficient contrast).

Remaining known issues

  • Keyboard traps (video on /otter-raft, details/summary on /showcase) — tracked separately
  • Carousel keyboard flakiness — tracked separately

Base automatically changed from fix/a11y-batch-1-quick-wins to dev May 16, 2026 15:32
@perasperaactual perasperaactual force-pushed the fix/a11y-batch-2-contrast branch from 73eddd7 to c2c1d94 Compare May 16, 2026 15:33
@github-actions
Copy link
Copy Markdown
Contributor

✅ Visual Regression Test Results

Status: ✅ All visual tests passed!

All screenshots match the baseline. No visual regressions detected! 🎉

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 16, 2026

⚡ Performance Benchmark Results

✅ Build Time Benchmarks: PASSED

✅ Bundle Size Benchmarks: PASSED

❌ Runtime Vitals Benchmarks: FAILED

📝 Note: Detailed results are available in the job logs.

🎯 Performance Budgets:

  • Build time: <70s total
  • First-load JS: <100KB gzipped
  • FCP: <1.5s, LCP: <2.5s, TTI: <3s

Updated: 2026-05-16T15:40:37.188Z

@perasperaactual perasperaactual force-pushed the fix/a11y-batch-2-contrast branch from c2c1d94 to 7ea6002 Compare May 16, 2026 15:37
@github-actions
Copy link
Copy Markdown
Contributor

✅ Visual Regression Test Results

Status: ✅ All visual tests passed!

All screenshots match the baseline. No visual regressions detected! 🎉

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 16, 2026

♿ Accessibility Test Results

Overall Status: ✅ 0/0 tests passed

🦮 WCAG 2.1 AA Compliance

No WCAG test results available

⌨️ Keyboard Navigation

No keyboard navigation test results available


⚠️ No accessibility tests were executed. Check the workflow logs for setup issues.

📊 Detailed Report

Download the full HTML accessibility report from the workflow artifacts for:

  • Detailed WCAG violation descriptions
  • Specific element selectors and fixes
  • Color contrast issues
  • Keyboard navigation flow analysis

🔍 Testing Checklist

Our accessibility tests verify:

  • ✅ WCAG 2.1 Level AA compliance
  • ✅ Color contrast in light and dark modes
  • ✅ Tab key navigation through all interactive elements
  • ✅ Focus indicators are visible
  • ✅ No keyboard traps
  • ✅ Skip links and ARIA landmarks
  • ✅ Screen reader compatibility

Powered by @axe-core/playwright and Playwright

@perasperaactual perasperaactual merged commit c344e9e into dev May 16, 2026
13 of 15 checks passed
@perasperaactual perasperaactual deleted the fix/a11y-batch-2-contrast branch May 16, 2026 15:54
perasperaactual added a commit that referenced this pull request May 17, 2026
…#435)

* fix(ci): resolve js-yaml override conflict breaking changeset pre exit

* fix(ci): handle modify/delete conflict on pre.json during back-merge rebase (#426)

Co-authored-by: Stackwright Bot <bot@per-aspera.dev>

* fix(ci): loop over pre.json conflicts during back-merge rebase (#428)

Co-authored-by: Stackwright Bot <bot@per-aspera.dev>

* chore: re-enter prerelease mode after back-merge

* fix(a11y): tabindex on code blocks, skip link, fix timeline heading level (#430)

Co-authored-by: Stackwright Bot <bot@per-aspera.dev>

* chore: bump prerelease versions

* fix(a11y): use surface luminance for syntax highlighting, fix dark mode + button contrast (#431)

Co-authored-by: Stackwright Bot <bot@per-aspera.dev>

* fix(a11y): FAQ keyboard trap, video accessible name, test false positive guards (#432)

* docs(a11y): document intentional Chromium-only CI scope for accessibility tests

* fix(a11y): migrate FAQ to Radix Accordion, video accessible name, fix trap/carousel test guards

* chore: update lockfile for @radix-ui/react-accordion in @stackwright/core

* test(core): update FAQ test for Radix Accordion refactor

The FAQ component was refactored to use Radix UI Accordion in this PR.
Update the stale test to click the trigger before asserting answer
visibility, and rename it to accurately reflect the new DOM structure.

---------

Co-authored-by: Stackwright Bot <bot@per-aspera.dev>

---------

Co-authored-by: Stackwright Bot <bot@per-aspera.dev>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions <github-actions@github.com>
perasperaactual added a commit that referenced this pull request May 18, 2026
* fix(ci): resolve js-yaml override conflict breaking changeset pre exit

* fix(ci): handle modify/delete conflict on pre.json during back-merge rebase (#426)

Co-authored-by: Stackwright Bot <bot@per-aspera.dev>

* fix(ci): loop over pre.json conflicts during back-merge rebase (#428)

Co-authored-by: Stackwright Bot <bot@per-aspera.dev>

* chore: re-enter prerelease mode after back-merge

* fix(a11y): tabindex on code blocks, skip link, fix timeline heading level (#430)

Co-authored-by: Stackwright Bot <bot@per-aspera.dev>

* chore: bump prerelease versions

* fix(a11y): use surface luminance for syntax highlighting, fix dark mode + button contrast (#431)

Co-authored-by: Stackwright Bot <bot@per-aspera.dev>

* fix(a11y): FAQ keyboard trap, video accessible name, test false positive guards (#432)

* docs(a11y): document intentional Chromium-only CI scope for accessibility tests

* fix(a11y): migrate FAQ to Radix Accordion, video accessible name, fix trap/carousel test guards

* chore: update lockfile for @radix-ui/react-accordion in @stackwright/core

* test(core): update FAQ test for Radix Accordion refactor

The FAQ component was refactored to use Radix UI Accordion in this PR.
Update the stale test to click the trigger before asserting answer
visibility, and rename it to accurately reflect the new DOM structure.

---------

Co-authored-by: Stackwright Bot <bot@per-aspera.dev>

* fix(example-app): update logo

* docs(readme): align value communication with project reality

- Add problem statement paragraph explaining AI amplification of architectural decisions
- Add "Who Is This For?" section with practical audience descriptions
- Tighten Safe by Construction section with "schema is the security policy" lede
- Add SBOM Generation subsection (lifted from CLAUDE.md where it was buried)
- Add Regulated Environments subsection; remove buried blockquote callout
- Add Quick Start heading to properly frame the git clone block

* docs(stackwright-docs): align site content with README value framing

- Homepage: add Who Is This For? section; update Safe by Construction card to surface SBOM
- Pro page: update Enterprise Ready card with PKI/CAC, CISA, and SBOM specifics
- Architecture page: update Auditable Surface Area card to mention SBOM formats

---------

Co-authored-by: Stackwright Bot <bot@per-aspera.dev>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions <github-actions@github.com>
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.

1 participant