Closed tbusillo closed 2 years ago
Hi @tbusillo , thanks for the extended report! I'm happy to accept a pull for this. Please choose the option that you think is best.
@smeijer Cool! Will try to get something in this week and thank you for taking a look/being open to the change!
Bug Report 🐛
I am more than happy to submit a PR for this, but wanted to submit an issue/get any feedback prior to doing so
There are several areas in the UI where color contrast can be improved, but one area that has the greatest impact on vision impaired and non-impaired users can be seen in the
Expandable
component's use of theIconButton
.This is an issue not just in terms of usability, but also in terms of inclusiveness and compliance with accessibility standards/guidelines (WCAG 1.4.3).
Color contrast between foreground and background colors for graphical objects/UI components should be, at minimum, a 3:1 ratio. Below are the current contrast ratios for two examples.
Example 1
Contrast contrast:
Example 2
Color contrast:
To Reproduce ✔️
Expected behavior 🤔
Hoverable and non-hoverable color states, especially for interactive elements, have sufficient contrast and are made more visible (regardless of contrast/accessibility).
Suggested solution 🔦
This is taking place due to the SVG icons using
fill="currentColor"
then inheriting from thelight
variant found in [testing-playground/src/components/IconButton.js], which islight: 'text-gray-400 hover:text-gray-600'
.I don't think anything is being passed into the
variant
prop, so it's defaulting tolight
[ref].Option 1: Introduce a
text-gray-500
variant, with a color of#728DA7
. This color's contrast would be sufficient for both elements.Option 2: Change the
light
variant's non-hovered text color totext-gray-600
Examples of what this would look like can be seen at https://play.tailwindcss.com/vWbA6C62QF and below.
Your Environment 💻
Additional comments