frontend: PluginSettings: Fix User-installed chip contrast#6110
Open
vtushar06 wants to merge 1 commit into
Open
frontend: PluginSettings: Fix User-installed chip contrast#6110vtushar06 wants to merge 1 commit into
vtushar06 wants to merge 1 commit into
Conversation
The "User-installed" chip used MUI color="info", which renders white text on info.main (#0288d1). That is only 3.85:1, below the WCAG AA minimum of 4.5:1 for normal text. Keep the info background but set the chip text to a dark color locally in PluginSettings, so it is not a global theme change. Dark text on info.main meets AA in both the light theme (5.44:1) and the dark theme (9.1:1, info.main #29b6f6). getContrastText is not used here because at the default contrastThreshold it returns white for info.main and would not reach 4.5:1. Also type the chip label map with ChipProps and SxProps instead of any. Snapshots for the MultipleLocations and MigrationScenario stories are updated for the new chip style. Signed-off-by: Tushar Verma <tusharmyself06@gmail.com>
Contributor
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: vtushar06 The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Contributor
Author
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.
The "User-installed" plugin chip rendered white text on the info blue (#0288d1), which is 3.85:1 and fails the WCAG AA minimum of 4.5:1 for normal text.
Fix: keep the info background and set the chip text to a dark color, scoped to this chip in PluginSettings so the theme is not changed globally. I checked it across themes: dark text on info.main is 5.44:1 on the light theme and 9.1:1 on the dark theme (info.main #29b6f6), both above 4.5:1. getContrastText is not used here because at our default contrastThreshold it returns white for info.main and would not reach AA.
The typeLabels map is now typed with ChipProps and SxProps instead of any.
Testing
Screenshots
The change only affects the text color of the "User-installed" chip. Before: white text on #0288d1 (3.85:1). After: dark text on the same blue (5.44:1 light, 9.1:1 dark). Happy to attach a before/after image if useful.
Fixes #4592