-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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
[material-ui][Rating] Failing on color contrast checks #39135
Comments
Hey @chris-gds good catch! |
I disagree with this expected behavior, icons aren't text, we can't use this reasoning. For example, none of these pass the test for text: https://mui.com/material-ui/react-rating/ The important aspect is to consider the surface. I think that https://contrast.tools/?tab=apca is a better tool to estimate if the color is accessible or not. Effective, it tells you from which font-size and font-weight the contrast passes the upcoming WCAG v3.0 color contrast thresholds. With the current color that Material UI uses IMHO, we could close the issue with the argument that the icon color is between Google Maps and Amazon the most used places where ratings are used. Which is what ultimately matters: that developers find something they can use without the need to change the default value because it's not what they expect. If we want to change the color, it feels like Amazon the upper range of the spectrum, it wouldn't work to go darker. |
WCAG also has a Non-text Contrast guide, so, therefore icons aren't text and shouldn't be treated as it, we surely can bump up the accessibility a bit. However, I agree with you that this won't work for all surfaces, the user will have to tweak it if they want to use on different backgrounds anyway.
I don't think that default look will be the decisive factor. The more we see the growth of headless components, the more we see that users are keen to use stuff that can be easily changed and customized, so I highly doubt that increasing the contrast for the default look will affect the developer experience. As I see, instead, this will only benefit Material UI accessibility, one of the most decisive factors that makes it stand out from competitors nowadays.
I don't know if I got it right, but I think we could have something like Amazon indeed, but it'd be a completely different approach to the current component—using the same color tone to filled and empty, and having a visible outline on the filled one. That said, on #39809, all that I did was to apply MD tokens to it: the |
Duplicates
Latest version
Steps to reproduce 🕹
Link to live example: https://mui.com/material-ui/react-rating/
Steps:
Current behavior 😯
The rating Design fails colour contrast checks WCAG 1.4.3. The grey on white and the yellow on white.
Expected behavior 🤔
I would expect the colours chosen to pass.
Context 🔦
Allows people who are blind or visually impaired to consume more easily should it meet standards.
Your environment 🌎
npx @mui/envinfo
The text was updated successfully, but these errors were encountered: