Skip to content
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

UI: Improve TransportModeChip text contrast accessibility #611

Merged
merged 1 commit into from
Feb 13, 2025

Conversation

ksharma-xyz
Copy link
Owner

@ksharma-xyz ksharma-xyz commented Feb 13, 2025

TL;DR

Enhanced color contrast handling for transport mode chips to ensure better accessibility

What changed?

  • Added contrast ratio checking for transport mode chip text colors
  • Introduced constants for WCAG AA contrast requirements
  • Enhanced getForegroundColor function to accept an optional foreground color parameter
  • Improved text color handling in TransportModeChip component

How to test?

  1. Navigate to the trip planner screen
  2. Verify that transport mode chip text remains readable when selected
  3. Check text contrast against different transport mode background colors
  4. Test with both light and dark themes

Why make this change?

To improve accessibility by ensuring text remains readable across all transport mode chips, regardless of their background color. This change follows WCAG AA guidelines for text contrast ratios, making the app more accessible to users with visual impairments.

Copy link
Owner Author

ksharma-xyz commented Feb 13, 2025

@ksharma-xyz ksharma-xyz force-pushed the 02-13-text_color_for_chip branch from 9355c98 to 819e7cb Compare February 13, 2025 00:26
@ksharma-xyz ksharma-xyz changed the title text color for chip UI: Improve TransportModeChip text contrast accessibility Feb 13, 2025
@ksharma-xyz ksharma-xyz marked this pull request as ready for review February 13, 2025 00:26
@ksharma-xyz ksharma-xyz changed the base branch from 02-12-prefer_param_color_and_then_localcomposition_color to graphite-base/611 February 13, 2025 04:31
@ksharma-xyz ksharma-xyz force-pushed the 02-13-text_color_for_chip branch from 819e7cb to 3d9ac8c Compare February 13, 2025 05:03
@ksharma-xyz ksharma-xyz changed the base branch from graphite-base/611 to main February 13, 2025 05:04
@ksharma-xyz ksharma-xyz force-pushed the 02-13-text_color_for_chip branch from 3d9ac8c to 927c012 Compare February 13, 2025 05:04
@ksharma-xyz ksharma-xyz merged commit 3941394 into main Feb 13, 2025
2 checks passed
Copy link
Owner Author

Merge activity

  • Feb 13, 6:49 AM EST: A user merged this pull request with Graphite.

@ksharma-xyz ksharma-xyz deleted the 02-13-text_color_for_chip branch February 13, 2025 11:49
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