[Rating] Use different shape for empty and filled icons#22554
Merged
oliviertassinari merged 3 commits intomui:nextfrom Sep 11, 2020
Merged
[Rating] Use different shape for empty and filled icons#22554oliviertassinari merged 3 commits intomui:nextfrom
oliviertassinari merged 3 commits intomui:nextfrom
Conversation
57a7b10 to
dca53e6
Compare
dca53e6 to
bcc2e21
Compare
|
@material-ui/lab: parsed: +0.13% , gzip: +0.18% |
mbrookes
reviewed
Sep 10, 2020
Co-authored-by: Matt <github@nospam.33m.co>
Member
|
Regarding the "Custom empty icon" demo – even though we now mention it in the accessibility section as problematic, perhaps it would be better to combine this with the "Hover feedback" demo, so that a single demo shows a color-only rating, with a text indicator? |
Member
Author
|
@eps1lon Thanks for opening an issue on the eBay side and pushing the discussion forward, happy to see they are heading to the same direction eBay/mindpatterns#19 (comment). |
mbrookes
approved these changes
Sep 11, 2020
Member
Author
|
cc @adrianmanea We will need to update the Figma and Sketch components. |
42 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Breaking changes
[Rating] Change the default empty icon to improve accessibility.
If you have a custom
iconprop but noemptyIconprop, you can restore the previous behavior with:<Rating icon={customIcon} + emptyIcon={null} />This is a continuation of #22541 by @eps1lon. The success Criterion 1.4.1 of WCAG 2.1. mentions the following:
The rationale is explained in https://www.w3.org/WAI/WCAG21/Understanding/use-of-color.html. Users with partial sight often experience limited color vision. It can even be as extreme as only seeing in the greyscale.
As it turns out, if you are color blind, you can't see the active value with the current implementation. It sucks:
value = 2
The proposed solution is based on #22541 (comment) and relies on:
After the changes applied, the component look as follow in the different color distortions: