Skip to content

Fix WCAG contrast issues in language switcher and footer for all languages#2440

Merged
pethers merged 2 commits into
mainfrom
copilot/fix-accessibility-contrast-issues
May 12, 2026
Merged

Fix WCAG contrast issues in language switcher and footer for all languages#2440
pethers merged 2 commits into
mainfrom
copilot/fix-accessibility-contrast-issues

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 12, 2026

Summary

Fixes accessibility contrast issues reported by Lighthouse (score 96) across all 14 language versions. The changes are CSS-only and affect the language switcher and footer elements.

Changes

Active language links (.site-language-switcher a.active, .site-footer .language-grid a.active)

  • Before: Yellow text (#ffbe0b) on nearly transparent yellow background (rgba(255, 190, 11, 0.12)) — ~1.5:1 contrast ratio on light backgrounds
  • After: Dark text (var(--dark-bg)) on solid yellow background (#ffbe0b) — ~12:1 contrast ratio ✓

Footer opacity

  • Before: opacity: 0.85 applied to .footer-bottom, .footer-disclaimer, .rm-footer-legal — reduced effective contrast below WCAG thresholds
  • After: Removed opacity, text now renders at full contrast

Footer language pills (.rm-footer-langs a)

  • Before: color-mix(in srgb, var(--light-text) 85%, transparent) — reduced contrast
  • After: color: var(--light-text, #e0e0e0) — full opacity text

Footer legal text (.rm-footer-legal)

  • Before: color-mix(in srgb, var(--light-text) 65%, transparent) — significantly reduced contrast
  • After: color: var(--text-secondary, #aaaaaa) — proper theme-aware color

Footer disclaimer links

  • Before: color: var(--link-color)#007744 in light mode (5.05:1 ratio, borderline)
  • After: color: var(--primary-color, #006633) — 6.48:1 ratio in light mode ✓

Additional improvements

  • Added explicit color: var(--text-color) for .site-language-switcher a (non-active links)
  • Dark mode overrides added for footer disclaimer links

WCAG 2.1 AA Compliance

All modified elements now meet the minimum 4.5:1 contrast ratio for normal text (WCAG 1.4.3).

Copilot AI and others added 2 commits May 12, 2026 22:52
- Active language links: solid yellow background with dark text (was
  transparent yellow bg with yellow text)
- Remove opacity: 0.85 from footer-bottom/disclaimer (reduced contrast)
- Add explicit color for site-language-switcher links
- Use full-opacity colors for rm-footer-langs and rm-footer-legal
- Use primary-color for footer-disclaimer links (higher contrast)
- Ensure dark mode overrides maintain contrast

Agent-Logs-Url: https://github.com/Hack23/riksdagsmonitor/sessions/62b28c3b-520a-407b-b398-91821ffb8846

Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
@github-actions github-actions Bot added the html-css HTML/CSS changes label May 12, 2026
Copilot AI requested a review from pethers May 12, 2026 22:54
@github-actions github-actions Bot added the size-s Small change (10-50 lines) label May 12, 2026
@github-actions
Copy link
Copy Markdown
Contributor

🏷️ Automatic Labeling Summary

This PR has been automatically labeled based on the files changed and PR metadata.

Applied Labels: html-css,size-s

Label Categories

  • 🗳️ Content: news, dashboard, visualization, intelligence
  • 💻 Technology: html-css, javascript, workflow, security
  • 📊 Data: cia-data, riksdag-data, data-pipeline, schema
  • 🌍 I18n: i18n, translation, rtl
  • 🔒 ISMS: isms, iso-27001, nist-csf, cis-controls
  • 🏗️ Infrastructure: ci-cd, deployment, performance, monitoring
  • 🔄 Quality: testing, accessibility, documentation, refactor
  • 🤖 AI: agent, skill, agentic-workflow

For more information, see .github/labeler.yml.

@github-actions
Copy link
Copy Markdown
Contributor

🔍 Lighthouse Performance Audit

Category Score Status
Performance 85/100 🟡
Accessibility 95/100 🟢
Best Practices 90/100 🟢
SEO 95/100 🟢

📥 Download full Lighthouse report

Budget Compliance: Performance budgets enforced via budget.json

@pethers pethers marked this pull request as ready for review May 12, 2026 22:56
Copilot AI review requested due to automatic review settings May 12, 2026 22:56
@pethers pethers merged commit 932988f into main May 12, 2026
12 checks passed
@pethers pethers deleted the copilot/fix-accessibility-contrast-issues branch May 12, 2026 22:56
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR aims to resolve WCAG 2.1 AA contrast findings (Lighthouse) by adjusting CSS for the language switcher active state and several footer text/link styles across all language versions.

Changes:

  • Updated active language link styling to use a solid yellow background and heavier font weight.
  • Increased footer text/link contrast by removing opacity and replacing color-mix(...) usage with fully opaque theme tokens.
  • Adjusted footer disclaimer link colors and added dark-mode-specific overrides.
Comments suppressed due to low confidence (1)

styles.css:13686

  • The @media (prefers-color-scheme: dark) and html[data-theme="dark"] blocks for .site-language-switcher a.active only re-declare the same color as the base rule, which adds noise and makes the cascade harder to reason about. Consider removing these duplicates (or scoping them only if you intend different values per mode).
/* Dark-mode active language link — dark text on solid yellow bg */
@media (prefers-color-scheme: dark) {
  .site-footer .language-grid a.active,
  .site-language-switcher a.active {
    color: var(--dark-bg, #0a0e27);
  }
}

html[data-theme="dark"] .site-footer .language-grid a.active,
html[data-theme="dark"] .site-language-switcher a.active {
  color: var(--dark-bg, #0a0e27);
}

Comment thread styles.css
Comment on lines 13667 to +13672
.site-footer .language-grid a.active,
.site-language-switcher a.active {
color: var(--primary-yellow, #ffbe0b);
color: var(--dark-bg, #0a0e27);
border-color: var(--primary-yellow, #ffbe0b);
background: rgba(255, 190, 11, 0.12);
background: var(--primary-yellow, #ffbe0b);
font-weight: 700;
Comment thread styles.css
Comment on lines 12385 to 12392
.footer-disclaimer a {
color: var(--link-color);
color: var(--primary-color, #006633);
text-decoration: underline;
}

.footer-disclaimer a:hover {
color: var(--link-hover);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

html-css HTML/CSS changes size-s Small change (10-50 lines)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants