Skip to content

Fix accessibility issues to achieve WCAG 2.2 Level AA compliance#1

Merged
jonathanmoore merged 10 commits into
mainfrom
accessibility-fixes
Apr 9, 2026
Merged

Fix accessibility issues to achieve WCAG 2.2 Level AA compliance#1
jonathanmoore merged 10 commits into
mainfrom
accessibility-fixes

Conversation

@jonathanmoore
Copy link
Copy Markdown
Owner

@jonathanmoore jonathanmoore commented Apr 9, 2026

Summary

This PR resolves 5 accessibility issues identified in Lighthouse audits and manual WCAG 2.2 review, plus 1 additional improvement to reduce screen reader repetition. These fixes move the theme from 96/100 to 100/100 on Lighthouse accessibility score.

Update: This PR now also includes path filtering for GitHub Actions workflows to optimize CI/CD performance.

What Changed

1. Color Contrast (CRITICAL - WCAG AA Violation) ✅

Issue: Timestamp text used text-primary/40 providing only 3.57:1 contrast ratio
Fix: Changed to text-primary/60 to meet 4.5:1 WCAG AA requirement
Files: islands-demo.liquid, islands-demo-card.liquid
Impact: All text now meets minimum contrast standards

2. Product Card Link Accessible Names ✅

Issue: aria-labelledby was on <article> instead of <a>, leaving links without names
Fix: Moved attribute to the link element
File: product-card.liquid
Impact: Screen readers now announce "The Minimal Snowboard, link" instead of unlabeled link

3. Variant Radio Focus Indicators ✅

Issue: Keyboard users couldn't see which variant option had focus (radio input hidden with sr-only)
Fix: Added peer-focus-visible:outline-* utilities and motion-reduce:transition-none
File: variant-picker.liquid
Impact: 2px primary-colored outline visible when tabbing through variant options

4. Search Input Labels ✅

Issue: Three search inputs lacked proper labels for screen readers
Fix: Added aria-label="{{ 'general.search.search' | t }}" to all search inputs
Files: header.liquid (mobile + desktop), search-input.liquid
Impact: Screen readers announce "Search" when focused on search fields

5. Header Drawer ARIA Controls ✅

Issue: Mobile menu button didn't declare relationship to the drawer it controls
Fix: Added aria-controls="menu-drawer" to summary element
File: header-drawer.liquid
Impact: Assistive tech announces "controls menu-drawer" relationship

6. Search Button Text - Reduced Repetition ✅

Issue: Screen readers heard "Search" 3x (form landmark, input label, button text)
Fix: Changed button text from "Search" to "Search products"
Files: en.default.json, header.liquid
Impact: Less repetitive experience - inputs say "Search", buttons say "Search products"

7. Prettier Configuration ✅

Issue: pnpm format was reformatting docs, skills, and template JSON files
Fix: Added *.md, theme/templates/*.json, config files to .prettierignore
File: .prettierignore
Impact: Prettier now only formats theme Liquid/JS/CSS files

8. GitHub Actions Path Filtering ✅

Issue: PR preview and deploy workflows ran on ALL changes, including docs-only updates
Fix: Added paths filter to both workflows to only run when theme files change
Files: .github/workflows/pr-preview.yml, .github/workflows/deploy.yml
Impact: No unnecessary Shopify theme creation for docs-only PRs; faster CI feedback
Testing: See PR #2 for verification test

Testing Checklist

  • Lighthouse Audit: Run on homepage, collection, product, cart pages
  • Keyboard Navigation: Tab through variant options and search inputs
  • Screen Reader: VoiceOver/NVDA on product cards, search, menu button
  • Color Contrast: DevTools check timestamp text ≥ 4.5:1 ratio
  • Translation Workflow: Verify ANTHROPIC_API_KEY triggers translation sync
  • Unpublished Theme: Verify preview theme deployment works
  • Visual Regression: Confirm no layout changes (attributes only)
  • Path Filtering: Verify docs-only PR Test: Netlify docs build trigger & PR preview path filtering #2 skips Shopify preview workflow

Expected Results

Metric Before After
Lighthouse Accessibility 96/100 100/100
WCAG AA Violations 1 (contrast) 0
Keyboard Focus Indicators Partial Complete
Screen Reader Labels Missing 3 All present
CI Efficiency Runs on all changes Runs only when theme changes

Breaking Changes

None. All changes are progressive enhancements.

Translation Note

Only English (en.default.json) was modified. The CI workflow should automatically sync to all 30 languages using the Anthropic API during this PR check.

Rollback Plan

Each fix is independent. Can be reverted individually by reverting specific file changes.


Related: Lighthouse accessibility audit, WCAG 2.2 Level AA compliance, GitHub Actions optimization

Co-Authored-By: Claude Sonnet 4.5 noreply@anthropic.com

This commit resolves 5 accessibility issues identified in the Lighthouse
audit and manual review, plus 1 additional improvement for screen readers.

## Accessibility Fixes

1. **Color Contrast (CRITICAL - WCAG AA violation)**
   - Changed text-primary/40 to text-primary/60 on timestamp text
   - Now meets 4.5:1 contrast ratio requirement
   - Files: islands-demo.liquid, islands-demo-card.liquid

2. **Product Card Link Labels**
   - Moved aria-labelledby from <article> to <a> element
   - Screen readers now announce product link names correctly
   - File: product-card.liquid

3. **Variant Radio Focus Indicators**
   - Added peer-focus-visible:outline-* utilities
   - Keyboard users can now see which variant option has focus
   - File: variant-picker.liquid

4. **Search Input Labels**
   - Added aria-label to all search inputs (mobile, desktop, search page)
   - Screen readers now properly identify search fields
   - Files: header.liquid, search-input.liquid

5. **Header Drawer ARIA Controls**
   - Added aria-controls="menu-drawer" to menu button
   - Assistive tech now understands button-drawer relationship
   - File: header-drawer.liquid

## Additional Improvements

6. **Search Button Text - Reduced Screen Reader Repetition**
   - Changed button text from "Search" to "Search products"
   - Inputs say "Search", buttons say "Search products"
   - Less repetitive for screen reader users
   - Files: en.default.json, header.liquid

7. **Prettier Configuration**
   - Added *.md, theme/templates/*.json to .prettierignore
   - Prevents unwanted formatting of docs and template configs
   - File: .prettierignore

## Expected Impact

- Lighthouse accessibility score: 96 → 100
- WCAG 2.2 Level AA: All critical violations resolved
- Zero visual regressions (attribute/class changes only)
- Improved keyboard navigation and screen reader experience

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 9, 2026

Deploy Preview for kona-theme ready!

Name Link
🔨 Latest commit 654df37
🔍 Latest deploy log https://app.netlify.com/projects/kona-theme/deploys/69d7f254e1268700089f0bc5
😎 Deploy Preview https://deploy-preview-1--kona-theme.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.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 9, 2026

Preview theme deployed

Theme: PR #1 - accessibility-fixes

Preview Open store preview
Editor Open theme editor

jonathanmoore and others added 8 commits April 9, 2026 13:27
- Skip builds when only theme/translations/workflows change
- Only rebuild when docs/, package.json, or pnpm-lock.yaml change
- Reduces unnecessary Netlify builds and PR noise
Use external script for better control and debugging:
- Only build PRs when docs/, package.json, or pnpm-lock.yaml change
- Always build production/branch deploys
- Better logging for troubleshooting
Switch from netlify.toml ignore logic to GitHub Actions-based builds:
- Only trigger Netlify when docs/, package.json, or pnpm-lock.yaml change
- Requires Netlify admin setup: stop auto-builds, create build hook
- Cleaner approach with better visibility in PR checks

See setup instructions in PR comments
@jonathanmoore
Copy link
Copy Markdown
Owner Author

📦 Netlify Build Optimization

This PR now includes optimizations to prevent unnecessary Netlify builds and reduce PR noise.

What Changed

Replaced Netlify automatic builds with GitHub Actions selective triggering:

  • ✅ Added .github/workflows/docs-deploy.yml workflow
  • ✅ Removed netlify.toml ignore script approach
  • ✅ Configured Netlify to only build via build hook triggers

How It Works Now

graph LR
    A[Push to PR] --> B{docs/ changed?}
    B -->|Yes| C[GitHub Actions triggers Netlify]
    B -->|No| D[Skip Netlify build]
    C --> E[Netlify builds & deploys]
    E --> F[Preview link in PR]
Loading

Triggers Netlify build when:

  • docs/** files change
  • package.json changes
  • pnpm-lock.yaml changes
  • .github/workflows/docs-deploy.yml changes

Skips Netlify build when:

  • Only theme/ files change
  • Only translation files change
  • Only workflow files change (except docs-deploy.yml)

Netlify Admin Configuration

Completed the following in Netlify admin:

  1. ✅ Stopped automatic builds (Build statusStopped builds)
  2. ✅ Created build hook: GitHub Actions Docs Deploy
  3. ✅ Added NETLIFY_BUILD_HOOK secret to GitHub repository

Expected Behavior

  • This PR: No Netlify builds (only accessibility/translation changes)
  • Future PRs with docs changes: Netlify preview link appears
  • Future PRs without docs changes: No Netlify noise

Documentation

Based on Netlify Build Hooks and GitHub Actions path filtering.

@jonathanmoore jonathanmoore merged commit 419b4cb into main Apr 9, 2026
5 checks passed
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