Accessibility issue reported #3785
-
Context: We are working on some fix and improvements since we were contacted by one of our clients who, during an accessibility audit, had some points that did not meet the accessibility standards. Issue reported: When hovering, the icon does not have enough contrast with the background color in the hover state. I am opening this thread to inform you that the token proposed for the over is not currently meeting the accessibility requirements. I am also requesting assistance in finding a solution, given the limitations of the available token palette. Alternatives found in Paste (it would solve just the light mode) One suggestion from @hannah (developer working on it)
Could you give us any suggestions or tell us if you agree with the suggested proposal? Looking forward to hear back from you :) |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 6 replies
-
🤖 Hey there, @cdpestitschek! 🎉 I'm Dosu, a bot here to sprinkle a bit of humor and some byte-sized help while you wait for a human maintainer to swing by. Though I might not run on caffeine or have human quirks, I'm programmed to help solve bugs, answer questions, and guide you on becoming a contributor. Consider me your digital sidekick in the coding realm! I'm diving into your issue about the accessibility concerns with icon contrast, and I'll get back to you with a more detailed answer shortly. Hang tight! |
Beta Was this translation helpful? Give feedback.
-
Disclaimer: This is a very experimental bot using OpenAI's GPT-4. The answers may not be correct, a human will review the answer and update it if necessary. Sorry, I don't know how to help with that. I did do a search though, and I managed to find these other Discussions that might be similar or related to your question. Give them a read to see if they answer your question. If they do, head back here and update this discussion and mark it as answered, pointing others to the related discussion:
|
Beta Was this translation helpful? Give feedback.
-
🤖 Based on the information you've provided, it seems like you're on the right track with your proposed solution. The idea of having slightly differing dark and light modes backgrounds with the hamburger menu white for both, and the hover as $color-background-stronger (Token value: rgb(136, 145, 170) / #8891AA) could potentially solve the issue. However, to ensure that your solution meets the accessibility requirements, I would recommend using the contrast checking functions provided in the Paste design system. These functions can be used to check the contrast ratio between different color tokens in your theme. For your specific issue of insufficient contrast between the icon and the background color in the hover state, you can use these functions to check the contrast ratio between your proposed hover color ( Here's an example of how you might do this: import { getContrastRatingsOfTokensWithUIControlContrastRequirements } from "@twilio-paste/design-tokens";
const contrastRating = getContrastRatingsOfTokensWithUIControlContrastRequirements({
backgroundColors: { 'color-background-stronger': '#8891AA' },
textColors: { 'color-text-icon': '#FFFFFF' },
});
console.log(contrastRating); This will return an array of contrast ratings for all combinations of background and text colors. You can then check these ratings to ensure that they meet the minimum contrast ratio for accessibility (3:1 for graphical objects and UI components). If the contrast ratio is below the minimum, you might consider adjusting the colors of your icon or hover state to increase the contrast. For example, you could use a darker color for your icon in light mode, or a lighter color for your hover state in dark mode. You can find more information about these functions in the themeContrast.spec.ts file in the Paste repository. Remember, the specific accessibility requirements for contrast ratios in the Paste design system are:
These requirements are outlined in the I hope this helps! If you have any other questions or need further clarification, feel free to ask. Sources
|
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
Hi there
I don't believe your customer report is correct.
The screenshot states "focus state" but the focus state has a 3 pixel border color change that not only passes based on it not being a color only change, but also the color of the border to the background of the top bar is greater than 3:1.
If they mean "hover" I don't believe that is correct either. The contrast of the bounding box isn't part of the success criteria anymore, if the content passes contrast of 3:1 or higher on the background of the control and the background of the container, which the hamburger icons does in both instances.
The requirement for the contrast between states such as default to hover was also moved to …